Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's no difference. An OWL ontology encoded in RDF is just another RDF document - there's nothing special about the OWL syntax as far as Jena is concerned. What matters in an RDF document is what triples it contains: that's why you can have RDF encoded in XML, Turtle or N-triples and they're all equivalent - just different ways of writing down the same triples.</p> <p>Once an RDF tool has loaded the triples into a graph (i.e. a <code>Model</code> in Jena), then it can give a different interpretation to terms from the <code>owl:</code> namespace.</p> <p><strong>Update</strong></p> <p>OK, following request in the comment here is code that generates your output sample:</p> <pre class="lang-java prettyprint-override"><code>package example; import com.hp.hpl.jena.ontology.*; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.vocabulary.*; public class OWLOutputExample { public static final String PLANTS = "http://www.linkeddatatools.com/plants"; public static void main( String[] args ) { new OWLOutputExample().run(); } public void run() { OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM ); setNamespaces( m ); populateOntology( m ); writeOntology( m ); } private void setNamespaces( OntModel m ) { m.setNsPrefix( "owl", OWL.getURI() ); m.setNsPrefix( "rdf", RDF.getURI() ); m.setNsPrefix( "rdfs", RDFS.getURI() ); m.setNsPrefix( "dc", DC_11.getURI() ); m.setNsPrefix( "plants", PLANTS ); } private void populateOntology( OntModel m ) { Ontology ont = m.createOntology( PLANTS ); ont.addProperty( DC_11.title, "The LinkedDataTools.com Example Plant Ontology" ) .addProperty( DC_11.description, "An example ontology written for the " + "LinkedDataTools.com RDFS &amp; OWL introduction tutorial" ); OntClass plantType = m.createClass( PLANTS + "#planttype" ); plantType.addProperty( RDFS.label, "The plant type" ) .addProperty( RDFS.comment, "The class of plant types." ); } private void writeOntology( OntModel m ) { m.write( System.out, "RDF/XML-ABBREV" ); } } </code></pre> <p>Output:</p> <pre class="lang-xml prettyprint-override"><code>&lt;rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:plants="http://www.linkeddatatools.com/plants" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"&gt; &lt;owl:Ontology rdf:about="http://www.linkeddatatools.com/plants"&gt; &lt;dc:description&gt;An example ontology written for the LinkedDataTools.com RDFS &amp;amp; OWL introduction tutorial&lt;/dc:description&gt; &lt;dc:title&gt;The LinkedDataTools.com Example Plant Ontology&lt;/dc:title&gt; &lt;/owl:Ontology&gt; &lt;owl:Class rdf:about="http://www.linkeddatatools.com/plants#planttype"&gt; &lt;rdfs:comment&gt;The class of plant types.&lt;/rdfs:comment&gt; &lt;rdfs:label&gt;The plant type&lt;/rdfs:label&gt; &lt;/owl:Class&gt; &lt;/rdf:RDF&gt; </code></pre> <p>Note that <code>rdfs:description</code> is not a known RDFS property, so I left it out.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload