Powered by Zoomin Software. For more details please contactZoomin

Semaphore Knowledge Model Management (KMM) How-To Articles

Semaphore RDF model structures for export and import

Semaphore RDF model structures for export and import

  • Last Updated: May 13, 2026
  • 3 minute read
    • Semaphore
    • Documentation

Explanation

Knowledge Model Management (KMM) allows you to export models for backup or for moving to other environments (like from a testing environment to a production environment).

This article explains what RDF formats Semaphore uses for imports and exports of models. This information is valid for the files included in the backup procedure on the main KMM page or for those produced by file import and export from within a model.

Assumptions

  • You have an existing model. (The model can be empty or have concepts in it.)
  • You have the MANAGER, EDITOR, or CONTRIBUTOR role for the model.

Method

KMM formats data in SKOS-XL, which uses Resource Description Framework (RDF) as a format. RDF presents model data in the form of subject–predicate–object (known as a triple). Triples represent distinct statements about concepts and their relationships to each other or attributes. The subject denotes the resource, and the predicate denotes traits or aspects of the resource, or a relationship between the subject and the object.

RDF can be serialized in multiple ways for viewing and exchanging between platforms. KMM uses these three serialized formats for exporting its semantic models or accepting models to be imported:

  • RDF/XML
  • N-Triple
  • Turtle

Each of these formats is explained below. (Examples come from a model called “Test Model”.)

RDF/XML

In RDF/XML, RDF triples are specified within an XML structure. The structure groups and defines sets of triples that have a common subject according to their types (e.g., classes, properties, concepts). Pieces of the semantic triples are represented as elements, attributes, or text strings.

An RDF/XML file has the extension: .rdf

Here is a sample of RDF/XML format.

<rdf:RDF>
  <owl:Ontology rdf:about="urn:x-evn-master:TestModel">
    <spin:imports rdf:resource="http://www.smartlogic.com/2018/04/semaphore-ordering-constraints"/>
    <owl:imports rdf:resource="http://www.smartlogic.com/2014/08/semaphore-core"/>
  </owl:Ontology>
  <owl:Class rdf:about="http://customNamespace.com/TestModel#Parent">
    <rdfs:label xml:lang="en">Parent</rdfs:label>
    <rdfs:subClassOf rdf:resource="http://customNamespace.com/TestModel#Person"/>
  </owl:Class>
  <owl:Class rdf:about="http://customNamespace.com/TestModel#Child">
    <rdfs:label xml:lang="en">Child</rdfs:label>
    <rdfs:subClassOf rdf:resource="http://customNamespace.com/TestModel#Person"/>
  </owl:Class>
</rdf:RDF>

In plain terms, this piece of code expresses the following:

  • Other developed models will be imported to “Test Model” so that their concepts and relationships can be referenced. These models are “semaphore-ordering-constraints” and “semaphore-core”
  • The model has a class called “Parent”, which also has a label and a parent class (“Person”).
  • The model has a class called “Child”, which also has a label and a parent class (“Person”).

This is the original RDF serialization format and is therefore well established in technology. However, there can be some situations in which parts of the model are not serialized correctly. We recommend using the N-Triple or Turtle formats wherever possible for exporting models.

See rdf-syntax-grammar for more specifics on RDF/XML format.

N-Triple

N-Triple is a very straightforward serialization format, and it is very easy for software to parse or generate. In this format, each line is a distinct semantic triple consisting of the subject (a URI Semaphore models), the predicate (always a URI), and the object (a URI or a literal in Semaphore models). This format can be easier than RDF/XMLfor a person to read and interpret, but because N-Triple format requires use of full URIs, it can still pose some difficulty. It also can create large output files because of each line needing to have a full triple.

An N-Triple file has the extension: .nt

Here is an example of N-Triple format (showing the same information the example above).

<urn:x-evn-master:TestModel> <http://spinrdf.org/spin#imports> <http://www.smartlogic.com/2018/04/semaphore-ordering-constraints> .
<urn:x-evn-master:TestModel> <http://www.w3.org/2002/07/owl#imports> <http://www.smartlogic.com/2014/08/semaphore-core> .
<http://customNamespace.com/TestModel#Parent> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
<http://customNamespace.com/TestModel#Parent> <http://www.w3.org/2000/01/rdf-schema#label> "Parent"@en . 
<http://customNamespace.com/TestModel#Parent> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://customNamespace.com/TestModel#Person> .
<http://customNamespace.com/TestModel#Child> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
<http://customNamespace.com/TestModel#Child> <http://www.w3.org/2000/01/rdf-schema#label> "Child"@en .
<http://customNamespace.com/TestModel#Child> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://customNamespace.com/TestModel#Person> .

See ntriples for more specifics on N-Triple format.

Turtle

Turtle stands for “Terse RDF Triple Language”. It is designed to be more compact in its presentation than other RDF serializations and more human-readable.

Like N-Triple, Turtle expresses data in triples; but unlike N-Triple, they do not need to be distinct on separate lines. Turtle allows ways to group items together in logical ways and to compact the file so that the output is smaller. It also allows aliasing on namespaces so that full URIs do not have to be expressed on every entity in the file.

A Turtle file has the extension: .ttl

Here is an example of Turtle format (showing the same information the examples above).

model:TestModel  spin:imports  <http://www.smartlogic.com/2018/04/semaphore-ordering-constraints> ;
        owl:imports   <http://www.smartlogic.com/2014/08/semaphore-core> .

<http://customNamespace.com/TestModel#Parent>     a       owl:Class ;
        rdfs:label       "Parent"@en ;
        rdfs:subClassOf  <http://customNamespace.com/TestModel#Person> .

<http://customNamespace.com/TestModel#Child>        a       owl:Class ;
        rdfs:label       "Child"@en ;
        rdfs:subClassOf  <http://customNamespace.com/TestModel#Person> .

See primer for more specifics on Turtle format.

TitleResults for “How to create a CRG?”Also Available inAlert