![]() |
| Previous Top Next |
Referencing the Ontology |
The AltovaDocuments.rdf ontology needs to be referenced by the RDF document so that its resources (classes, properties, and instances) become available for use in the RDF document. The ontology referencing mechanism in SemanticWorks is implemented via a two-step procedure:
| • | Import namespaces from the ontology. In this step, each ontology namespace to be imported is listed, together with the location of the file. This is done in the Namespace Imports dialog (Tools | Namespace Imports for RDF). |
| • | Declare the namespaces that will be used in the RDF document. All namespaces that will be used in the RDF document, including the imported namespaces, are declared, and prefixes are assigned for namespaces. This enables you to use the prefixes as shorthand for the namespace part of URIrefs. Namespaces are declared in the URIref Prefixes dialog (Tools | URIref Prefixes). |
For your RDF document, you should carry out these two steps as described below.
Importing namespaces from the ontology
The ontology you will be referencing is the OWL DL ontology AltovaDocuments.rdf, which you created in the previous part of this tutorial. This ontology uses three namespaces that you need to import into the RDF document:
| • | http://www.w3.org/XMLSchema# |
| • | http://www.altova.com/ontologies/document# |
| • | http://purl.org/dc/elements/1.1/ |
To import these namespaces, do the following:
| 1. | Click Tools | Namespace Imports for RDF. This pops up the Namespace Imports dialog (screenshot below). |

| 2. | Add a line for a new entry by clicking the Add button, then enter the first namespace in the Namespace column and the location of the AltovaDocuments.rdf ontology in the Import File column. Note that you should give the absolute path for the ontology document. |
| 3. | Repeat Step 2 twice to add the next two namespaces and the ontology location. (The ontology location is the same for all three namespaces.) |
| 4. | When you are done, click OK. |
Declaring namespaces for the RDF document
The RDF document you are creating uses three namespaces in addition to the RDF namespace:
| • | XML Schema namespace: http://www.w3.org/2001/XMLSchema#, to be declared with a prefix of xsd. |
| • | A namespace for the Altova document vocabulary: http://www.altova.com/ontologies/document#, with a prefix of doc. |
| • | The Dublin Core namespace for defining document metadata: http://purl.org/dc/elements/1.1/, with a prefix of dc. |
Namespaces are declared in the URIref Prefixes dialog (Tools | URIref Prefixes) shown below. Add a line for each required namespace using the Add button. Then enter the namespace and its prefix.

You are now ready to start making RDF statements using resources from the AltovaDocuments.rdf ontology.
Troubleshooting
If the resources from the ontology do not appear in the Resources Overview, check the following:
| • | That RDF level is selected. |
| • | That the namespaces are correctly entered. You should also check that they tally with the namespaces in the ontology document. |
| • | That the location of the ontology file is an absolute path and is correctly entered. |
| • | That namespaces have been correctly declared for the RDF document. |
|