You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commonsrdf.apache.org by st...@apache.org on 2016/11/21 11:16:07 UTC

incubator-commonsrdf git commit: Introduction to RDF using Commons RDF

Repository: incubator-commonsrdf
Updated Branches:
  refs/heads/master da91cb73a -> 567b775be


Introduction to RDF using Commons RDF

SVG files are made using
ttps://www.draw.io/

When saving, use
File -> Export as -> SVG
  Zoom: 100%
  (x) Transparent background
  (x) Include a copy of the diagram
Then re-insert these comments in the replaced SVG.


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/567b775b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/567b775b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/567b775b

Branch: refs/heads/master
Commit: 567b775be8eac714d557a2c3cc171895f7c08c6c
Parents: da91cb7
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Mon Nov 21 11:06:45 2016 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Mon Nov 21 11:15:46 2016 +0000

----------------------------------------------------------------------
 examples/src/example/IntroToRDF.java     |  79 ++++++
 examples/src/example/IntroToRDFTest.java |  30 ++
 src/site/markdown/introduction.md        | 383 ++++++++++++++++++++++++++
 src/site/resources/images/rdf-01.svg     |  30 ++
 src/site/resources/images/rdf-02.svg     |  31 +++
 5 files changed, 553 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/567b775b/examples/src/example/IntroToRDF.java
----------------------------------------------------------------------
diff --git a/examples/src/example/IntroToRDF.java b/examples/src/example/IntroToRDF.java
new file mode 100644
index 0000000..0aa97f0
--- /dev/null
+++ b/examples/src/example/IntroToRDF.java
@@ -0,0 +1,79 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package example;
+
+import org.apache.commons.rdf.api.*;
+import org.apache.commons.rdf.simple.SimpleRDF;
+
+public class IntroToRDF {
+    public static void main(String[] args) {
+        RDF rdf = new SimpleRDF();
+
+        IRI alice = rdf.createIRI("Alice");
+        System.out.println(alice.ntriplesString());
+
+        IRI knows = rdf.createIRI("knows");
+        IRI bob = rdf.createIRI("Bob");
+
+        Triple aliceKnowsBob = rdf.createTriple(alice, knows, bob);
+        System.out.println(aliceKnowsBob.getSubject().ntriplesString());
+
+        System.out.println(aliceKnowsBob);
+
+        Graph graph = rdf.createGraph();
+        graph.add(aliceKnowsBob);
+
+        IRI charlie = rdf.createIRI("Charlie");
+
+        IRI plays = rdf.createIRI("plays");
+
+        IRI football = rdf.createIRI("Football");
+        IRI tennis = rdf.createIRI("Tennis");
+
+        graph.add(alice, knows, charlie);
+        graph.add(alice, plays, tennis);
+        graph.add(bob, knows, charlie);
+        graph.add(bob, plays, football);
+        graph.add(charlie, plays, tennis);
+
+        System.out.println("Who plays Tennis?");
+        for (Triple triple : graph.iterate(null, plays, tennis)) {
+            System.out.println(triple.getSubject());
+            System.out.println(plays.equals(triple.getPredicate()));
+            System.out.println(tennis.equals(triple.getObject()));
+        }
+
+        System.out.println("Who does Alice know?");
+        for (Triple triple : graph.iterate(alice, knows, null)) {
+            System.out.println(triple.getObject());
+        }
+
+
+        System.out.println("Does Alice anyone that plays Football?");
+        for (Triple triple : graph.iterate(alice, knows, null)) {
+            RDFTerm aliceFriend = triple.getObject();
+            if (! (aliceFriend instanceof BlankNodeOrIRI)) {
+                continue;
+            }
+            if (graph.contains( (BlankNodeOrIRI)aliceFriend, plays, football)) {
+                System.out.println("Yes, " + aliceFriend);
+            }
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/567b775b/examples/src/example/IntroToRDFTest.java
----------------------------------------------------------------------
diff --git a/examples/src/example/IntroToRDFTest.java b/examples/src/example/IntroToRDFTest.java
new file mode 100644
index 0000000..4399355
--- /dev/null
+++ b/examples/src/example/IntroToRDFTest.java
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package example;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class IntroToRDFTest {
+
+  @Test
+  public void runIntroToRDF() {
+    IntroToRDF.main(new String[0]);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/567b775b/src/site/markdown/introduction.md
----------------------------------------------------------------------
diff --git a/src/site/markdown/introduction.md b/src/site/markdown/introduction.md
new file mode 100644
index 0000000..d494562
--- /dev/null
+++ b/src/site/markdown/introduction.md
@@ -0,0 +1,383 @@
+# Introduction to RDF using Commons RDF
+
+This page is a tutorial to introduce programming with the
+[Resource Description Framework (RDF)](https://www.w3.org/TR/rdf11-concepts/)
+using Java and [Apache Commons RDF](index.md).
+If you already know RDF, you may instead jump ahead to the
+[Commons RDF user guide](userguide.html).
+
+This is not meant as an extensive RDF tutorial, for that please consult the
+[W3C RDF 1.1 Primer](https://www.w3.org/TR/rdf11-primer/). You may also like
+the
+[Apache Jena introduction to RDF](https://jena.apache.org/tutorials/rdf_api.html)
+which uses the [Apache Jena](https://jena.apache.org/) implementation directly.
+
+This tutorial attempts to show the basic concepts of RDF and how you can
+work with RDF programmatically using the
+[Apache Commons RDF API](index.md) in a simple Java program.
+
+
+## Getting started with Commons RDF
+
+This tutorial will assume you already know
+a bit of [Java programming](http://docs.oracle.com/javase/tutorial/)
+and that you use an _IDE_ like
+[Eclipse](http://www.eclipse.org/) or
+[Netbeans](https://netbeans.org/).  Note that Commons RDF requires
+Open JDK 8, [Java 8](https://www.java.com/) or equivalent.
+
+The Commons RDF JARs are [available from Maven Central](download.html).
+While there are multiple [Commons RDF implementations](implementations.html),
+this tutorial will use the built-in _simple_ implementation as it requires no
+additional dependencies.
+
+First, create a new Java project for this tutorial, say `rdftutorial`.
+
+**Tip**: Check that your IDE project is using the **Java 8** syntax and compiler.
+
+We'll create the package name
+`org.example`, but you can use whatever you prefer. Then create `RdfTutorial.java`
+with a static `main()` method we can run:
+
+```java
+package org.example;
+
+import org.apache.commons.rdf.api.*;
+import org.apache.commons.rdf.simple.SimpleRDF;
+
+public class RdfTutorial {
+    public static void main(String[] args) {
+      // ...
+    }    
+}
+```
+
+
+### Adding Commons RDF to the class path
+
+Above we added the `import` for the Commons RDF API, but the library
+is not yet on your class path.
+
+**Note**: If you are already familiar with
+_Maven_, then see instead
+[how to use Commons RDF from Maven](userguide.html#Using_Commons_RDF_from_Maven) and add
+the `commons-rdf-simple` dependency to your project. This will make it easier later
+to share your project or to use newer versions of Commons RDF.
+
+This tutorial assumes a classic Java project with local `.jar` files (say in your project's `lib/` folder), so download and add to your project's class path:
+
+* [commons-rdf-api-0.3.0-incubating.jar](https://repo.maven.apache.org/maven2/org/apache/commons/commons-rdf-api/0.3.0-incubating/commons-rdf-api-0.3.0-incubating.jar)
+([signature](https://repo.maven.apache.org/maven2/org/apache/commons/commons-rdf-api/0.3.0-incubating/commons-rdf-api-0.3.0-incubating.jar.asc))
+* [commons-rdf-simple-0.3.0-incubating.jar](https://repo.maven.apache.org/maven2/org/apache/commons/commons-rdf-simple/0.3.0-incubating/commons-rdf-simple-0.3.0-incubating.jar) ([signature](https://repo.maven.apache.org/maven2/org/apache/commons/commons-rdf-simple/0.3.0-incubating/commons-rdf-simple-0.3.0-incubating.jar.asc))
+
+_Tip: If you prefer you can [verify the  signatures](https://www.apache.org/info/verification.html) using the Commons RDF [KEYS](http://www.apache.org/dist/incubator/commonsrdf/KEYS)._
+
+As there are [multiple Commons RDF implementations](implementations.html),
+we have to say which one we want to use. Add to your `RdfTutorial` class:
+
+```java
+RDF rdf = new SimpleRDF();
+```
+
+If you have the classpath set up correctly, you should now
+be able to compile `RdfTutorial` without warnings.
+
+
+## RDF resources
+
+"The clue is in the name"; the _Resource Description Framework_ (RDF) is
+for describing **resources**. But what is a resource?
+
+Anything can be a resource, it is just a concept we want to describe,
+like computer _files_ (text document, image, database),
+_physical things_ (person, place, cat),
+_locations_ (city, point on a map), or more _abstract concepts_ (organization,
+disease, theatre play).
+
+To know which concept we mean, in RDF the resource needs to either:
+
+* have a global _identifier_; we call this an **IRI**
+* be used _indirectly_ in a statement; we call this a **blank node**
+* be a _value_, we call this a **literal**
+
+In this tutorial we'll use the _IRI_ syntax `<identifier>` to indicate an identified resource,
+the _blank node_ syntax `_:it` to indicate an indirectly referenced
+resource, and the _literal_ syntax `"Hello"` to indicate a value.
+
+Don't worry about this syntax, RDF is a **model** with several
+ways to represent it when saved to a file; the [Commons RDF API](apidocs/index.html?org/apache/commons/rdf/api/package-summary.html) directly
+reflects the RDF model in a syntax-neutral way.
+
+Let's create our first identified resource, an `IRI` instance:
+
+```java
+IRI alice = rdf.createIRI("Alice");
+System.out.println(alice.ntriplesString());
+```
+
+This should print out:
+
+> `<Alice>`
+
+
+**Note**: For simplicity this tutorial use _relative IRI references_ which
+are not really global identifiers. While this is supported by
+`SimpleRDF`, some implementations will require
+_absolute IRIs_ like `<http://example.com/Alice>`.
+
+### Triples
+
+
+To describe a resource in RDF we provide one or more statements,
+which are called _triples_ of 3 resources
+(_subject_, _predicate_, _object_):
+
+```turtle
+<Alice> <knows> <Bob> .
+```
+
+![Alice knows Bob](images/rdf-01.svg)
+
+This RDF statement is a relationship between the **subject** `<Alice>`
+and the **object** `<Bob>`, not dissimilar from the subject and direct object
+of the similar English sentence _"Alice knows Bob"_.
+
+What kind of relationship? Well, that is
+identified with the **predicate** `<knows>`.
+The relationship is _directional_, from the subject to the object;
+although _Alice knows Bob_, we don't know if Bob really knows Alice!
+In RDF the predicate is also called a _property_ as it is
+describing the subject.
+
+You may have noticed that properties are also resources -
+to understand
+the kind of relationship we also need a description of it's concept.
+More about this later!
+
+Let's try to create the above statement
+in Commons RDF; first we'll create the remaining
+resources `<knows>` and `<Bob>`:
+
+```java
+IRI knows = rdf.createIRI("knows");        
+IRI bob = rdf.createIRI("Bob");
+```
+
+Note that the Java variable names `alice`, `knows` and `bob`
+are not important to Commons RDF,
+we could as well have called these `a`, `k`, `b`,
+but to not confuse yourself it's good to keep the variable names
+somewhat related to the captured identifiers.
+
+Next we'll create a `Triple`:
+
+```java
+Triple aliceKnowsBob = rdf.createTriple(alice, knows, bob);
+```
+
+We can access `.getSubject()`, `.getPredicate()` and `.getObject()` from a `Triple`:
+
+```java
+System.out.println(aliceKnowsBob.getSubject().ntriplesString());
+System.out.println(aliceKnowsBob.getPredicate().ntriplesString());
+System.out.println(aliceKnowsBob.getObject().ntriplesString());
+```
+
+> `<Alice>` <br>
+> `<knows>` <br>
+> `<Bob>`
+
+_**Tip**: Instances from `SimpleRDF` can be printed directly, as
+`System.out` would use their `.toString()`,
+but for consistent behaviour across implementations we use `.ntriplesString()` above._
+
+With `SimpleRDF` we can also print the `Triple` for debugging:
+
+```java
+System.out.println(aliceKnowsBob);
+```
+
+> `<Alice> <knows> <Bob> .`
+
+
+### Graph
+
+By using the same identified resources in multiple triples, you can
+create a _graph_. For instance, this graph shows multiple relations
+of `<knows>` and `<plays>`:
+
+```turtle
+<Alice> <knows> <Bob> .
+<Alice> <knows> <Charlie> .
+<Alice> <plays> <Tennis> .
+<Bob> <knows> <Charlie> .
+<Bob> <plays> <Football> .
+<Charlie> <plays> <Tennis> .
+```
+
+The power of a graph as a data structure is that you don't have to decide a
+hierarchy. The statements of an RDF graph can be listed in any order, and so
+we should not consider the `<Alice>` resource as anything more special
+than `<Bob>` or `<Tennis>`.
+
+![Graph of Alice knows Bob and Charlie, Alice and Charlie play Tennis, Bob plays Football](images/rdf-02.svg)
+
+It is therefore possible to _query_ the graph, such as _"Who plays Tennis?_ or
+_"Who does Alice know?"_, but also more complex, like
+_"Does Alice anyone that plays Football?"_.
+
+Let's try that now using Commons RDF. To keep the triples we'll need a `Graph`:
+
+```java
+Graph graph = rdf.createGraph();
+```
+
+We already have the first triple, so we'll `.add()` it to the `graph`:
+
+```java
+graph.add(aliceKnowsBob);
+```
+
+Before adding the remaining statements we need a few more resources:
+
+```java
+IRI charlie = rdf.createIRI("Charlie");
+
+IRI plays = rdf.createIRI("plays");
+
+IRI football = rdf.createIRI("Football");        
+IRI tennis = rdf.createIRI("Tennis");
+```
+
+Now we use the `graph.add(subj,pred,obj)` shorthand which creates the
+`Triple` instances and add them to the graph.
+
+```java
+graph.add(alice, knows, charlie);
+graph.add(alice, plays, tennis);
+graph.add(bob, knows, charlie);
+graph.add(bob, plays, football);
+graph.add(charlie, plays, tennis);
+```
+
+Next we'll ask the graph those questions using `.iterate(s,p,o)` and
+`null` as the wildcard.
+
+```java
+System.out.println("Who plays Tennis?");
+for (Triple triple : graph.iterate(null, plays, tennis)) {
+    System.out.println(triple.getSubject());
+}
+```
+
+> `Who plays Tennis?` <br>
+> `<Alice>` <br>
+> `<Charlie>`
+
+
+Notice how we only print out the `.getSubject()` (our wildcard), if you
+check `.getPredicate()` or `.getObject()` you will find they are equal to
+`plays` and `tennis`:
+
+```java
+System.out.println("Who plays Tennis?");
+for (Triple triple : graph.iterate(null, plays, tennis)) {
+    System.out.println(triple.getSubject());
+    System.out.println(plays.equals(triple.getPredicate()));
+    System.out.println(tennis.equals(triple.getObject()));
+}
+```
+
+We can query with wildcards in any positions, for instance for
+the _object_:
+
+```java
+System.out.println("Who does Alice know?");
+for (Triple triple : graph.iterate(alice, knows, null)) {
+    System.out.println(triple.getObject());
+}
+```
+
+> `Who does Alice know?` <br>
+> `<Bob>` <br>
+> `<Charlie>`
+
+Let's try to look up which of those friends play football:
+
+```java
+System.out.println("Does Alice anyone that plays Football?");
+for (Triple triple : graph.iterate(alice, knows, null)) {
+    RDFTerm aliceFriend = triple.getObject();
+    if (graph.contains(aliceFriend, plays, football)) {
+        System.out.println("Yes, " + aliceFriend);
+    }
+}
+```
+
+You will get a compiler error:
+
+> `RDFTerm` cannot be converted to `BlankNodeOrIRI`
+
+This is because in an RDF triple, not all kind of resources can be used in all
+positions, and the kind of resource in Commons RDF is indicated by the
+interfaces:
+
+* [IRI](apidocs/org/apache/commons/rdf/api/IRI.html) (identified)
+* [BlankNode](apidocs/org/apache/commons/rdf/api/BlankNode.html) (indirect)
+* [Literal](apidocs/org/apache/commons/rdf/api/Literal.html) (value)
+
+Look at the method signature of [graph.contains(s,p,o)](http://commonsrdf.incubator.apache.org/apidocs/org/apache/commons/rdf/api/Graph.html#contains-org.apache.commons.rdf.api.BlankNodeOrIRI-org.apache.commons.rdf.api.IRI-org.apache.commons.rdf.api.RDFTerm-):
+
+```java
+boolean contains(BlankNodeOrIRI subject,
+                 IRI predicate,
+                 RDFTerm object)
+```
+
+In short, for any RDF triple:
+
+* The **subject** must be a [BlankNodeOrIRI](apidocs/org/apache/commons/rdf/api/BlankNodeOrIRI.html), that is either a `BlankNode` or `IRI`
+* The **predicate** must be a [IRI](apidocs/org/apache/commons/rdf/api/IRI.html) (so we can look up what it means)
+* The **object** must be a [RDFTerm](apidocs/org/apache/commons/rdf/api/RDFTerm.html), that is either a `BlankNode`, `IRI` or `Literal`
+
+As we are retrieving triples from the graph, the `triple.getObject()` is only known
+to be an RDFTerm if we use it as a Java variable - there could in theory be triples
+in the graph with `Literal` and `BlankNode` objects:
+
+```
+<Alice> <knows> "Santa Claus".
+<Alice> <knows> _:someone.
+```
+
+
+In this case we could have done a naive casting like `(IRI)aliceFriend`; we
+inserted her `IRI`-represented friends right before, but this is a toy
+example - there's no need to use RDF if you already know the answer!
+
+So unless you know for sure in your graph that `<knows>` is never used with a
+literal value as object, this would not be safe. So we'll do an `instanceof`
+check (skipping any literals) and cast to `BlankNodeOrIRI`:
+
+
+```java
+System.out.println("Does Alice anyone that plays Football?");
+for (Triple triple : graph.iterate(alice, knows, null)) {
+    RDFTerm aliceFriend = triple.getObject();
+    if (! (aliceFriend instanceof BlankNodeOrIRI)) {
+        continue;
+    }
+    if (graph.contains( (BlankNodeOrIRI)aliceFriend, plays, football)) {
+        System.out.println("Yes, " + aliceFriend);
+    }
+}
+```
+
+> `Does Alice anyone that plays Football?`
+> `Yes, <Bob>`
+
+## Literal values
+
+We talked briefly about literals above as a way to represent values in RDF.
+What is a value? In a way you could a value is when we no longer want to
+stay in graph land and just want to use primitive types like `long`,
+`int` or `String`.  

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/567b775b/src/site/resources/images/rdf-01.svg
----------------------------------------------------------------------
diff --git a/src/site/resources/images/rdf-01.svg b/src/site/resources/images/rdf-01.svg
new file mode 100644
index 0000000..19056b3
--- /dev/null
+++ b/src/site/resources/images/rdf-01.svg
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<!--
+To edit, use https://www.draw.io/
+When saving, use
+File -> Export as -> SVG
+  Zoom: 100%
+  (x) Transparent background
+  (x) Include a copy of the diagram
+-->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="425px" height="136px" version="1.1" content="&lt;mxfile userAgent=&quot;Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/53.0.2785.143 Chrome/53.0.2785.143 Safari/537.36&quot; version=&quot;6.0.1.5&quot; editor=&quot;www.draw.io&quot; type=&quot;google&quot;&gt;&lt;diagram&gt;7VdNc5swEP01HNsBhIl9DI7dHNqZzuTQ9CgLGdQIxAj5K7++K7MCYxvbSTs5JZdIT7srad/bFfbItNh+07TKf6iUSy/0061HHrwwDMgkhn8W2TXInT9pgEyLFI064Em8cgR9RFci5XXP0Cgljaj6IFNlyZnpYVRrtembLZXs71rRjJ8AT4zKU/SXSE3eoOMw7vBHLrLc7RzEeL+COmO8SZ3TVG0OIDLzyFQrZZpRsZ1yaZPn8tL4zQdW24NpXppbHMLGYU3lCu/mhTEtKo8kEgIkiVq0QGYBPLbZuVxAPEg7TJJNLgx/qiizKxtgHrDcFBJmgY1HF1wmlL1kWq3KdKqk0rBUqtI6L4WUDvJCMp/Pkvmd3VTTVMBlemv3yXRufVRp5rQQ0srokcs1N4JRXEDVBATnBwH8/R/gVIqsBIzBBhwWk5aOoL3qmmvDt4PpDVrSQO1cFdzoHZigw8jxjEIPSdTMN51sAmeTH0hmjBhFpWZt6I5MGCCf57klp1ylIGOcKm1ylamSylmHJmyl1zzFBOx5amdMFYLB2O/TCpnQu2fE95PfOKkN1ebelltH8x6bC3tmdEidBZO0
 ru0OFkQTu8EfbswO2aQrowDqzv5dqQrtaqPVCz+geTEeRSO/XXGVGv4P5fCtMM8uAzB2dz6S8XLMOGNXxd8QZdnp6axWK80QwtYC6cu46dXu7WokzsWp0Y+GVYZRfioBwYdDRHE/RHNm9DpsPEeBoslAZbhAzU1PAoFa6O7ArLIG9RsOjHceOteIjC/Zw6A5QVeBbZ5vKsroSsN9Ke3rdLnlQj8y/SLUvBavdLE3sDLErID1KPFGD+dane1roHl5jwuFSNN9C7jSp88UyGAlnaucwa6KjzXeonsiD/VNLurb/+r78V2Pvi/IvuaSGrHu19cNsndhgiOZq+Wy5uZIGW/VwuhTC/+ghcu9LiJBTwjB5MKL+pGkx1dIBw6g539+c737myv8wG8umHbf6o0Yul88ZPYX&lt;/diagram&gt;&lt;/mxfile&gt;"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffebf7-1-ffabcf-1-s-0"><stop offset="0%" style="stop-color:#FFEBF7"/><stop offset="100%" style="stop-color:#FFABCF"/></linearGradient></defs><g transform="translate(0.5,0.5)"><ellipse cx="361" cy="91" rx="60" ry="40" fill="#000000" stroke="#000000" transform="translate(2,3)" opacity="0.25"/><ellipse cx="361" cy="91" rx="60" ry="40" fill="url(#mx-gradient-ffebf7-1-ffabcf-1-s-0)" stroke="#000000" pointer-events="none"/><g transform="translate(341.5,84.5)"><switch><foreignObject
  style="overflow:visible;" pointer-events="all" width="38" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 40px; white-space: nowrap; word-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;Bob&gt;</div></div></foreignObject><text x="19" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;Bob&amp;gt;</text></switch></g><path d="M 103 63 Q 103 21 211 21 Q 319 21 319 54.76" fill="none" stroke="#b85450" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 319 60.76 L 315 52.76 L 319 54.76 L 323 52.76 Z" fill="#b85450" stroke="#b85450" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><g transform="transl
 ate(186.5,0.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="52" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; white-space: nowrap; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;knows&gt;</div></div></foreignObject><text x="26" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;knows&amp;gt;</text></switch></g><ellipse cx="61" cy="91" rx="60" ry="40" fill="#000000" stroke="#000000" transform="translate(2,3)" opacity="0.25"/><ellipse cx="61" cy="91" rx="60" ry="40" fill="url(#mx-gradient-ffebf7-1-ffabcf-1-s-0)" stroke="#000000" pointer-events="none"/><g transform="translate(38.5,84.5)"><switch><foreignObject style="o
 verflow:visible;" pointer-events="all" width="44" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 44px; white-space: nowrap; word-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;Alice&gt;</div></div></foreignObject><text x="22" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;Alice&amp;gt;</text></switch></g></g></svg>

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/567b775b/src/site/resources/images/rdf-02.svg
----------------------------------------------------------------------
diff --git a/src/site/resources/images/rdf-02.svg b/src/site/resources/images/rdf-02.svg
new file mode 100644
index 0000000..0d62cbf
--- /dev/null
+++ b/src/site/resources/images/rdf-02.svg
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<!--
+To edit, use https://www.draw.io/
+When saving, use
+File -> Export as -> SVG
+  Zoom: 100%
+  (x) Transparent background
+  (x) Include a copy of the diagram
+Then re-insert these comments in the replaced SVG.    
+-->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="665px" height="415px" version="1.1" content="&lt;mxfile userAgent=&quot;Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/53.0.2785.143 Chrome/53.0.2785.143 Safari/537.36&quot; version=&quot;6.0.1.6&quot; editor=&quot;www.draw.io&quot; type=&quot;device&quot;&gt;&lt;diagram&gt;7VpLc+I4EP41HCdlWX4eAwk7h5mqqcpW7exR2MJoIyxKFq/59Sth2UYmfkCATGXMJVZLaj366+7PHY/gZLn7i6PV4juLMR3ZVrwbwaeRbQMALflHSfa5JHC9XJBwEutBleCF/MJaqOclaxLjzBgoGKOCrExhxNIUR8KQIc7Z1hw2Z9RcdYUSfCJ4iRA9lf5DYrHQp7C9Sv4Vk2RRrAy8MO+Zoeg14Wyd6vVGNpwffnn3EhW69EGzBYrZ9kgEn0dwwhkT+dNyN8FU3W1xbfm8aUNvuW+OU9Fngp1P2CC6xsWOPbRcjeCYSgXjMZuVgkQJ9LbFvrgqqU9aRTbG2wUR+GWFItWzlcCQsoVYUtkCSh+aYTou72fCKOOyK2WpmjwnlBYieWnT6fN46qtFOYqJPIzR9zieTNUcloopWhKqUPYV0w0WJEK6Q4MKQN0+UmAdflKOKElSKYvkAlh2jktzgPKoG8wF3jVeLyiNJp0BsyUWfC+H6AnQ13bWfmBDmLe3FapAgYXFEaICLUMayEmpujKmfND2fNu28NRWsUS5bjIuFixhKaLPlXQcrfkGx/oCDnYqWxFbkkg+W6ZZ
 5U3w/U8tPzT+1Y1MIC4elTdWZj7IpkTtWU+IixERRVmmVlBCPUQt8B8WYq+tidaCSVG192+MrfS4THD2io/MPAtcx7XKnsKR7WsgB++I+FncgHwuzlyD8TyIcBR1gj83lLKOgbOMrXmkRTryyOtLsDB8tz8agW+baLRgM8q0lh+MSOXNKhzXVJHvWc86Djw1RdBp8IxCUX7SE0USLWh/NGylBmRnbFifuXFfQdA2Xj7kO6g8sLznXk7pdATc11Qlr/aQK+ORMJ2Q44z8QrPDAAVDfStytDseuU9vhToV1yTm6aPuWJI4PoSAjjj9hoM0etJbntMYVXUu16eoUuQxvmErvq0Hy/J8w3xftPU5pkiQjelfPWBfqAGeOYXN5xkWNWSciwV3wMI7sNAe6+wAGEAAQfh7GN3rMLq0gYz5A+e6mHN9JOXyO4w7WSBOyWDeK1Jq6Ib3s28wUOq7UmpwZ0rtn02pazQWAv9sSl1X4dYyVW9KXRRZmhQ1UOoLklg4MJd3MJfgU7HYomY3gOEGNBYC06ftoH98ua3VQYfVp4yJGVJzPoDrxAgH8+j2fOYkQXpRgGfz6zAdD3wgkwX2H051Skt+XPWwRPFFVKc/0JwaAwFh/9TSoOKknNeXxHg1EnOrumDTmfvuqzb+3XVBADvi6Yqi/ZBFG7Oo/bk4VVeZeEDD5ZzKdULTlf3fhVN1FYT/xmlKusw+MKrmonBoBn3Xsu7IqLy7MKo/gTdZD47bXiXqSZ2Uhh+YE2lMBcWnKvKcWzkqfPcMel8r+/jBuaSrpsGxayjty7ls32tXdL3CEeiqkA+JrTWxeZ+L5gQDGm5Gc2xofskAw/5fe9zW6uGQCO/zv5K+WbAowpQVmUNB4sHtlw39a2RDGJg5yLPd3mgtXundGrvzLsyHXi0f+k7tBeFKNQjXridwv3Vf9fGuY3zc+e4ahN1VyR/CcWs4Du+dnHeFGjPSf4E137lK2La7Kv4DOi5P1k7tz
 dRpe+O8Iwpks/oYPR9effEPn/8H&lt;/diagram&gt;&lt;/mxfile&gt;"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffebf7-1-ffabcf-1-s-0"><stop offset="0%" style="stop-color:#FFEBF7"/><stop offset="100%" style="stop-color:#FFABCF"/></linearGradient></defs><g transform="translate(0.5,0.5)"><ellipse cx="361" cy="103" rx="60" ry="40" fill="#000000" stroke="#000000" transform="translate(2,3)" opacity="0.25"/><ellipse cx="361" cy="103" rx="60" ry="40" fill="url(#mx-gradient-ffebf7-1-ffabcf-1-s-0)" stroke="#000000" pointer-events="none"/><g transform="translate(341.5,96.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="38" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 40px; white-space: nowrap; word-wrap: normal; text-align: center
 ;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;Bob&gt;</div></div></foreignObject><text x="19" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;Bob&amp;gt;</text></switch></g><path d="M 103 75 Q 103 33 211 33 Q 319 33 319 66.76" fill="none" stroke="#b85450" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 319 72.76 L 315 64.76 L 319 66.76 L 323 64.76 Z" fill="#b85450" stroke="#b85450" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><g transform="translate(186.5,12.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="52" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; white-space: nowrap; text-align:
  center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;knows&gt;</div></div></foreignObject><text x="26" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;knows&amp;gt;</text></switch></g><ellipse cx="61" cy="103" rx="60" ry="40" fill="#000000" stroke="#000000" transform="translate(2,3)" opacity="0.25"/><ellipse cx="61" cy="103" rx="60" ry="40" fill="url(#mx-gradient-ffebf7-1-ffabcf-1-s-0)" stroke="#000000" pointer-events="none"/><g transform="translate(38.5,96.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="44" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 44px; white-space: nowrap; word-wrap: normal; text-align: center;"><di
 v xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;Alice&gt;</div></div></foreignObject><text x="22" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;Alice&amp;gt;</text></switch></g><ellipse cx="361" cy="229" rx="60" ry="40" fill="#000000" stroke="#000000" transform="translate(2,3)" opacity="0.25"/><ellipse cx="361" cy="229" rx="60" ry="40" fill="url(#mx-gradient-ffebf7-1-ffabcf-1-s-0)" stroke="#000000" pointer-events="none"/><g transform="translate(332.5,222.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="56" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 58px; white-space: nowrap; word-wrap: normal; text-align: center;"><div xmlns="
 http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;Charlie&gt;</div></div></foreignObject><text x="28" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;Charlie&amp;gt;</text></switch></g><path d="M 103 131 Q 319 131 319 192.76" fill="none" stroke="#b85450" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 319 198.76 L 315 190.76 L 319 192.76 L 323 190.76 Z" fill="#b85450" stroke="#b85450" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><g transform="translate(221.5,110.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="52" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; white-space: nowrap; text-align: center;"><div 
 xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;knows&gt;</div></div></foreignObject><text x="26" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;knows&amp;gt;</text></switch></g><ellipse cx="601" cy="103" rx="60" ry="40" fill="#000000" stroke="#000000" transform="translate(2,3)" opacity="0.25"/><ellipse cx="601" cy="103" rx="60" ry="40" fill="#dae8fc" stroke="#6c8ebf" pointer-events="none"/><g transform="translate(569.5,96.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="62" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 62px; white-space: nowrap; word-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style
 ="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;Football&gt;</div></div></foreignObject><text x="31" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;Football&amp;gt;</text></switch></g><path d="M 371 63 Q 371 21 479 21 Q 587 21 587 54.76" fill="none" stroke="#6c8ebf" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 587 60.76 L 583 52.76 L 587 54.76 L 591 52.76 Z" fill="#6c8ebf" stroke="#6c8ebf" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><g transform="translate(457.5,0.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="46" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; white-space: nowrap; text-align: center;"><div xmlns="http://www.w3.org/1
 999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;plays&gt;</div></div></foreignObject><text x="23" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;plays&amp;gt;</text></switch></g><ellipse cx="281" cy="370" rx="60" ry="40" fill="#000000" stroke="#000000" transform="translate(2,3)" opacity="0.25"/><ellipse cx="281" cy="370" rx="60" ry="40" fill="#dae8fc" stroke="#6c8ebf" pointer-events="none"/><g transform="translate(254.5,363.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="52" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; width: 54px; white-space: nowrap; word-wrap: normal; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;te
 xt-align:inherit;text-decoration:inherit;">&lt;Tennis&gt;</div></div></foreignObject><text x="26" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;Tennis&amp;gt;</text></switch></g><path d="M 55 143 Q 55 237 168 237 Q 281 237 281 321.76" fill="none" stroke="#6c8ebf" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 281 327.76 L 277 319.76 L 281 321.76 L 285 319.76 Z" fill="#6c8ebf" stroke="#6c8ebf" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><g transform="translate(146.5,216.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="46" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; white-space: nowrap; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml" style="di
 splay:inline-block;text-align:inherit;text-decoration:inherit;">&lt;plays&gt;</div></div></foreignObject><text x="23" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;plays&amp;gt;</text></switch></g><path d="M 403 257 Q 451 257 451 313.5 Q 451 370 349.24 370" fill="none" stroke="#6c8ebf" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><path d="M 343.24 370 L 351.24 366 L 349.24 370 L 351.24 374 Z" fill="#6c8ebf" stroke="#6c8ebf" stroke-width="2" stroke-miterlimit="10" pointer-events="none"/><g transform="translate(398.5,303.5)"><switch><foreignObject style="overflow:visible;" pointer-events="all" width="46" height="13" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; font-size: 13px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; vertical-align: top; white-space: nowrap; text-align: center;"><div xmlns="http://www.w3.or
 g/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;">&lt;plays&gt;</div></div></foreignObject><text x="23" y="13" fill="#000000" text-anchor="middle" font-size="13px" font-family="Helvetica">&amp;lt;plays&amp;gt;</text></switch></g></g></svg>