Learning RDF and RDFS – help!

I’m getting myself up to speed on RDF (and RDFS) and building molecular repositories as an example. I’m using  the Jena Semantic Web Framework (Open Source , Java, HP-inspired) and so far like it. But I have only done a little bit (subject-predicate-object) Jim tells me that what I have produced so far needs cleaning up. As a minimum I have to use RDF types (rdf:type).
I like learning by example – give me a few examples of RDF-XML and the corresponding Jena code and that will go a long way. But although I could do this easily for the simple stuff the Jena tutorial runs out before RDFS. And the Javadoc is enormous. I’m impressed, but I don’t know where to start. There are no obvious package or class names. Everything uses abstract language. How do I learn about ranges and domains unless I can see some working examples and create some?
So rather than exposiing this on an RDF-specific list (which I may do later) I’m wondering if there are any kind readers who can point to some examples of RDFS-XML and even better if they can suggest how to hack them in Jena.

This entry was posted in programming for scientists and tagged , , . Bookmark the permalink.

3 Responses to Learning RDF and RDFS – help!

  1. Jim Downing says:

    TheN3 primer includes some basic RDFS.

  2. Leigh Dodds says:

    This simple RDF Schema I wrote may be useful as a simple example of basic RDFS concepts including range and domain:
    To load RDF data into Jena you need to do something like:
    Model myData = FileManager.loadModel(pathToFile);
    To load an RDF schema:
    Model mySchema = FileManager.loadModel(pathToSchema);
    Then if you want to manipulate your data, using the schema, you need to create a combined model:
    Model inferenceModel = ModelFactory.createRDFSModel( mySchema, myData );
    Then you use the methods on the Model interface, which is the primary way to access RDF data using Jena. In the above examples, if you manipulate “myData”, you’ll only see the raw data. If you manipulate “inferenceModel” you’ll also have access to any triples inferred from the basic schema.
    However, unless you’ve got a specific need for RDFS, I’d just dive into creating some data and working with it in Jena. Unlike an XML schema and RDF schema doesn’t provide validation.
    Btw, if you get as far as wanting to explore SPARQL, i.e. simplying querying your molecular repositories, then my query tool and tutorial might be useful:
    Feel free to drop me an email if you have specific questions. The #swig and #jena IRC channels on freenode.net are also good places to ask questions.

  3. Bill Roberts says:

    You may well have seen this:
    I find it one of the best introductory articles on RDF and RDFS – a good balance of enough detail without getting bogged down in technicalities.
    Maybe it’s a matter of personal preference, but I have found that my understanding of all matters RDF is helped greatly by ignoring the XML format for RDF whenever possible! I tend to always think of RDF /S in terms of “blobs and lines”. And the N3 format is much more readable and hence understandable than the RDF-XML format.

Leave a Reply

Your email address will not be published. Required fields are marked *