|Version 7 (modified by lgiessmann, 3 years ago)|
Isidorus offers the functions "setup-rdf-module" and "rdf-importer" in the package "rdf-importer" to import RDF/XML files.
"setup-rdf-module" imports the additional XTM file "rdf_core_psis.xtm" which contains some predifined topics for the RDF2TM mapping before importing the actual RDF/XML file.
"rdf-importer" just imports the given RDF/XML file.
Information about the RDF/XML file, the data base, etc. can be entered via the parameters:
- rdf-xml-path: specifies the file which has to be imported
- repository-path: the path to the data base folder
- tm-id: the identifier of the imported Topic Map respectively RDF ontology. It must be of the form of an absolute URI
- document-id: the identifier for the imported document. This id enables to determine "relative" node-ids in the entire data base
- Resource-nodes are mapped to topics. The Resource-URI is set as the topic's PSI. If the resource is a blank node, the generated topic owns an item-identifier with the prefix " http://isidorus/rdf2tm_mapping/blank_node/" and a generated ID
- Statements with object nodes that are literal nodes are mapped to occurrences. The occurrence-type is the URI of the predicate. The value is the literal node's content with the default data type "string". If the statement defines an data type it will be also set as the occurrence data type. Existing xml:lang attributes are mapped to occurrence scopes with the predifined URI-prefix " http://isidorus/rdf2tm_mapping/scope/" and the actual value as the URI-suffix.
- Statements with object nodes that are resource nodes are mapped to associations. The subject node and the object node are imported as topics. These topics are associated with an TM-association of the type of predicate-URI. To determine the RDF-direction the subject-node is referenced by a role of the predifend type " http://isidorus/rdf2tm_mapping/subject", the object resource is referenced by the role of the type " http://isidorus/rdf2tm_mapping/object"
- rdf:type statements are mapped to type-instance associations
- rdfs:subClassOf statements are mapped to supertype-subtype associations
- Collections are mapped to a kind linked lists, every resource which is represented as a topic is linked via an TM-association. This is very similar to an "raw" RDF-collection
- rdf:li elements are mapped to URIs corresponding to the order of the rdf:li element starting by rdf:_1 and incremented with every new rdf:li element
- rdf:ID (reification) is mapped to the correponding reification-object of the TM-construct, e.g. a property that is mapped to an association is reified by the resource-topic that reifies the original property
Offering the function "export-rdf" in the package "rdf-exporter" Isidorus enables to export Topic Maps and mapped RDF files as RDF/XML files.
The following parameters can be set:
- rdf-path: a string that descirbes the destination file path
- tm-id: the Topic Map ID of the topic map which has to be exported. If tm-id is set to nil, the entire data base is exported
- revision: the revision of all exported objects. Thus just obejcts with the given version are exported
- Importded RDF/XML objects which were not changed are exported as the original objects
- Topics: Topics are exported as resource-nodes with the URI of the first (in the storage) PSI. If there are any other or additional idetifiers they are exported as statements with literal nodes. The nodes' contents are the URIs. If a topic owns statements of an isidorus-type, e.g. a mapped name, it is of the type " http://isidorus/rdf2tm_mapping/types/Topic".
- Names: Names are exported as blank nodes of the type " http://isidorus/rdf2tm_mapping/types/Name". These blank nodes own several statements that describes all necessary information, e.g. name-type, name-value, name-variants, ...
- Occurrences: Occurrence are alos exported as blank nodes. The are of the type " http://isidorus/rdf2tm_mapping/types/Occurrence" and owns further statements with the TM information, e.g. occurrence-type, scopes, .... If an Occurrence owns just an occurrence-value it is mapped to an RDF-statement with a literal-node.
- type-instance association: this association is mapped to a statement of the type rdf:type
- supertype-subtype association: this association is mapped to a statements of the type rdfs:subClassOf
- Associations: Associations are mapped as blank nodes of the type " http://isidorus/rdf2tm_mapping/types/Association". The TM information is included as further statements, e.g. scopes, association-type, roles. Every role is represented by a blank node as well. Such a blank node is of the type isidorus:Role and contains information of the role-player, the role-type and an optional item-idenifier.
- reification: all constructs are reifed as RDF defines it, i.e. with the rdf:ID attribute. E.g. a name is reified with the rdf:ID attribute in the property that contains the name-resource-node.
TM-.ssociations has to be reified with an additional property since the association itself is not represented as a property but as a reouce-node. So there exist the isidorus:association-reifier property.