Help:Import vocabulary (Vocabulary definition)

From semantic-mediawiki.org
User manualSemantic WebImporting vocabularyHelp:Import vocabulary (Vocabulary definition)

Wiki-users with the appropriate administrative rights (requires write access to the MediaWiki namespace) can add new elements by simply editing a specific page for each vocabulary the match the "magic" name. This help page explains how vocabulary definitions are created.

The page is placed in the "Mediawiki" namespace with the prefix smw_import_ and as an example the page for the FOAF vocabulary is named MediaWiki:smw_import_foaf. It contains something like

http://xmlns.com/foaf/0.1/|[http://www.foaf-project.org/ Friend Of A Friend]
 name|Type:Text
 homepage|Type:URI
 Person|Category
 knows|Type:Page
 ...

The first line tells the wiki that

After this, there is a line that declares each vocabulary element that can be reused within the wiki. For instance, "name" (referring to "foaf:name") can only be a property of datatype "Text"Holds text of arbitrary length. The text after the "|" declares the (unique) context in which some element can be used. Elements that can be imported as properties are declared by specifying their type with Type:some datatype, elements that can be imported as categories are declared by specifying the "Category" namespace identifier. (Note that in Semantic MediaWiki 1.0Released on 31 December 2007 and compatible with MW 1.9.x - 1.12.x. the type and namespace depends on your language setting!). Moreover, one can also declare other elements by writing anything else than the above; however, we strongly recommend you use one meaningful string; we suggest "Main", although you can use such elements in namespace other than "Property" and "Category" as well.

Strict typing[edit]

Imported vocabularies expect a type definition (except Categories those are mapped as rdf:type) which means a definition (in MediaWiki:Smw_import_yyy) is required a type to describe a qualified imported vocabulary.

For example, the property foaf:name is declared as a datatype "Text"Holds text of arbitrary length through the assignment found in it's import statement.

Invalid type declaration[edit]

If for some reason a type declaration is invalid or incomplete then special page "ExportRDF"No description was provided. will produce an invalid XML (see SMW issue 1488).1 and it is recommended to run maintenance script "rebuildData.php"Allows to rebuild all the semantic data for a selected data backend/store or to make a null edit on a specific property to correct possible incorrect assignments.

See also[edit]

References

  1. ^  Semantic MediaWiki: GitHub issue gh:smw:1488