Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, you can use the string based approach, though I'd strongly recommend something like: </p> <pre class="lang-java prettyprint-override"><code>String SIOC = "http://sioc.com/ontologies/sioc#"; model.setNsPrefix("sioc",SIOC ); Property ID = model.createProperty( SIOC + "ID" ); </code></pre> <p>to save some typing and possible typos. For many common vocabularies, Jena already has predefined vocabulary classes that define a bunch of useful constants. Most of these live in the <a href="http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/vocabulary/package-summary.html" rel="nofollow">com.hp.hpl.jena.vocabulary</a> package. For instance, in <a href="http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/vocabulary/DCTerms.html" rel="nofollow"><code>DCTerms</code></a> there are constants such as <a href="http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/vocabulary/DCTerms.html#creator" rel="nofollow"><code>creator</code></a> so that you can do things like </p> <pre class="lang-java prettyprint-override"><code>Resource r = ...; r.addProperty( DCTerms.creator, ... ); </code></pre> <p>Of course, Jena can only predefine so many of these classes. For others, you can use Jena's <a href="http://jena.apache.org/documentation/tools/schemagen.html" rel="nofollow">schemagen</a> to generate those kinds of classes. It's a command line tool (but you can also call it programmatically, I believe), and pass it the RDF or OWL file that defines the vocabulary, and you get a <code>.java</code> file back that constants constants for all the properties, classes, and individuals in the vocabulary. You can get simple Model-based resources, or OntModel-based resources, too. It's quite configurable, and I've used in a number of projects.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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