Difference between revisions of "Help:SemanticMW import external vocabulary"
GiselaWeber (Talk | contribs) |
m (ul fix) |
||
Line 52: | Line 52: | ||
*the name deviates from the pagename without namespace prefix, e.g. | *the name deviates from the pagename without namespace prefix, e.g. | ||
− | |||
**it is the full name while the pagename is a short form | **it is the full name while the pagename is a short form | ||
− | |||
**it includes the namespace prefix (we can also use the separate <nowiki>[[Attribute:Ns]]</nowiki>) | **it includes the namespace prefix (we can also use the separate <nowiki>[[Attribute:Ns]]</nowiki>) | ||
− | |||
**it starts with a lowercase letter | **it starts with a lowercase letter | ||
− | |||
*selection with an inequality | *selection with an inequality | ||
− | |||
Formally, ''FoafName'' is represented by the [http://xmlns.com/foaf/0.1/ FOAF] property <nowiki>[[imported from::foaf:name]]</nowiki>. | Formally, ''FoafName'' is represented by the [http://xmlns.com/foaf/0.1/ FOAF] property <nowiki>[[imported from::foaf:name]]</nowiki>. |
Revision as of 14:33, 24 May 2011
Help sections |
---|
Contents · Semantic MediaWiki · Semantic Forms |
Add Ontology · Semantic links and import/export features · Import external vocabulary |
Other SemanticMW extensions · Other extensions |
In Semantic MediaWiki it is possible to import and reuse controlled vocabulary that belongs to existing Semantic Web documents or standards by associating the vocabulary's elements with wiki terms.
Contents
Import vocabulary
An example of this functionality is the use of the FOAF vocabulary in the TestWiki. Although the associated terms work like any other annotation in the wiki, the RDF that is exported will directly use the elements of the FOAF specification, thus allowing users to edit FOAF files through the wiki.
Importing an external vocabulary into a SMW property consists on three steps:
Making vocabularies available for import
- The page is in the Mediawiki namespace with the prefix smw_import_.
Create an entry in MediaWiki namespace having the following format:
Mediawiki:Smw_import_vocabulary_name
where vocabulary_name is the name of the imported vocabulary. The first part of the new created service name is mandatory prefixed by Mediawiki:Smw_import_ For example, the page for the foaf vocabulary is named MediaWiki:smw_import_foaf.
- edit the new page and insert vocabulary elements having the following format:
http://xmlns.com/foaf/0.1/|[http://www.foaf-project.org/ Friend Of A Friend] name|Type:String homepage|Type:URI Person|Category knows|Type:Page .......
- save the page.
Create property or modify an existing one
Create a SMW Property. When the Property already exists, edit it and add the vocabulary element to the property as follows:
This is a property of type [[has type::Element type|Element type]] and is imported from [[imported from::vocabulary_name:vocabulary_element]]
For example in the page Property:FoafName:
This is a property of type [[has type::String|strings]] and is imported from [[imported from::foaf:name]].
The names of the selected pages, without namespace prefix, are either shown automatically in query results, or optionally by specifying mainlabel. Names are [[has type::String|String]].
Applications of Property FoafName include:
- the name deviates from the pagename without namespace prefix, e.g.
- it is the full name while the pagename is a short form
- it includes the namespace prefix (we can also use the separate [[Attribute:Ns]])
- it starts with a lowercase letter
- selection with an inequality
Formally, FoafName is represented by the FOAF property [[imported from::foaf:name]].
- Save the Property page.
Property usage
The property could be used as any other property. Use the new created property in a wiki page as:
[[FoafName::somename]]
When this page will be exported as RDF, the property will appare like:
...... <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">somename</foaf:name> ......
Changing import statements
It can easily happen that some existing article of the wiki should be modified to represent (another) imported concept. For example, a wiki community that already uses a category "Person" might decide to map this category to "foaf:Person" in the future. Import statements in existing articles can be changed at any point in time without requiring additional updates in the wiki. The exported RDF will immediately be modified accordingly.
Use cases
Import Dublin Core terms
An example of vocabulary import is:
http://purl.org/dc/terms/|[http://purl.org/dc/terms/ dcterms] Policy|Category isVersionOf|Type:Page tableOfContents|Type:Page FileFormat|Category publisher|Type:Page PeriodOfTime|Category relation|Type:Page MediaTypeOrExtent|Category rightsHolder|Type:Page coverage|Type:Page type|Type:Page URI|Type:Page MethodOfAccrual|Category LCSH|Type:Page mediator|Type:Page extent|Type:Page Point|Type:Page hasFormat|Type:Page LocationPeriodOrJurisdiction|Category LinguisticSystem|Category creator|Type:Page DDC|Type:Page available|Type:Text identifier|Type:Text accrualMethod|Type:Page rights|Type:Page PhysicalMedium|Category spatial|Type:Page accessRights|Type:Page Jurisdiction|Category description|Type:Page ProvenanceStatement|Category RFC3066|Type:Page TGN|Type:Page modified|Type:Text conformsTo|Type:Page license|Type:Page dateCopyrighted|Type:Text RightsStatement|Category subject|Type:Page date|Type:Text Standard|Category isReferencedBy|Type:Page Box|Type:Page temporal|Type:Page requires|Type:Page dateAccepted|Type:Text hasPart|Type:Page UDC|Type:Page references|Type:Page Frequency|Category BibliographicResource|Category dateSubmitted|Type:Text Agent|Category isFormatOf|Type:Page RFC1766|Type:Page contributor|Type:Page RFC4646|Type:Page replaces|Type:Page accrualPolicy|Type:Page audience|Type:Page MESH|Type:Page hasVersion|Type:Page isRequiredBy|Type:Page medium|Type:Page LCC|Type:Page accrualPeriodicity|Type:Page MediaType|Category DCMIType|Type:Page AgentClass|Category bibliographicCitation|Type:Text isReplacedBy|Type:Page format|Type:Page LicenseDocument|Category alternative|Type:Page valid|Type:Text provenance|Type:Page language|Type:Page SizeOrDuration|Category educationLevel|Type:Page created|Type:Text ISO639-2|Type:Page ISO639-3|Type:Page ISO3166|Type:Page isPartOf|Type:Page IMT|Type:Page title|Type:Page issued|Type:Text PhysicalResource|Category MethodOfInstruction|Category instructionalMethod|Type:Page Period|Type:Page W3CDTF|Type:Page source|Type:Page abstract|Type:Page Location|Category NLM|Type:Page
See also: Import dcterms