Denigma
hevok @hevok February 18, 2013
Tutorial #facts #rdf #representation #xml

Simple Facts in RDF

RDF is simple constitute out of facts are build all in the same way, subject, property and value of this property (Object).

Turtle representation is the standard for RDF.

XML can easily be used to represent simple facts in RDF:


http://denigma.de/profiles">](http://denigma.de/profiles)]

    http://denigma.de/profiles/profile/Hevok">](http://denigma.de/profiles/profile/Hevok)]


"++49-123-4567-890">



    http://denigma.de/profiles/profile/Hevok">](http://denigma.de/profiles/profile/Hevok)]


http://denigma.de/blog/" />](http://denigma.de/blog/)]



This can be made shorter:


http://denigma.de/profiles">](http://denigma.de/profiles)]

    "++49-123-4567-890">


http://denigma.de/blogs/" />](http://denigma.de/blogs/)]



A base can be defined to be commonly appended:


http://denigma.de/profiles">](http://denigma.de/profiles)]
        xml:base="['>http://http://denigma.de/profiles/profiles">](http://http://denigma.de/profiles/profiles)]




http://denigma.de/blogs/" />](http://denigma.de/blogs/)]


Short cut in Turtle:

@prefix rdf: ](http://www.w3.org/1999/02/22-rdf-synthax-ns#>)] .
@prefix prof: ](http://denigma.de/profiles>)] .
@base ](http://denigma.de/profiles/profile>)] .

:Hevok prof:hasPhoneNumber "++49-123-4567-890";
    prof:writesBlog ](http://denigma.de />)] .

In Turtle is pretty short and it is much more convenient to encode in Turtle than in XML.

rdf:ID is always extended with the hash and the name is prefixed by the base.


http://denigma.de/profiles">](http://denigma.de/profiles)]
     xml:base="['>http://http://denigma.de/profiles/profiles">](http://http://denigma.de/profiles/profiles)]




http://denigma.de/blogs/" />](http://denigma.de/blogs/)]


The same in Turtle is just 4 line:

@prefix rdf: ](http://www.w3.org/1999/02/22-rdf-synthax-ns#>)] .
@prefix prof: ](http://denigma.de/profiles>)] .

:Hevok prof:hasPhoneNumber "++49-123-4567-890";
       prof:writesBlog ](http://denigma.de />)] .

Datatypes can be used to specify the exact nature of the Literal:


http://denigma.de/profiles" >](http://denigma.de/profiles)]

   http://denigma.de/event#conference05">](http://denigma.de/event#conference05)]
       http://www.w3c.org/2001/XMLSchema#string">](http://www.w3c.org/2001/XMLSchema#string)]
           5. Continues Longevity Conference Meeting

       http://www.w3c.org/2001/XMLSchema#integer">](http://www.w3c.org/2001/XMLSchema#integer)]4