Help: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.
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
- the abbreviation "foaf:" refers to "http://xmlns.com/foaf/0.1/" and that
- "Friend Of A Friend" should be given as an additional human-readable label for elements of this vocabulary (e.g. in the factbox).
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. 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 SMW 1.0 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.
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.
Invalid type declaration
If for some reason a type declaration is invalid or incomplete then the ExportRDF will produce an invalid XML 1 and it is recommended to run
rebuildData.php or to make a null edit on a specific property to correct possible incorrect assignments.
- 1488 "ExportRDF produces XML Parsing Error: « xmlns:="" »"