To launch Apache Any23 service on your own computer:
./[PATH-to-unpacked-archive]/apache-any23-service-1.1-server-embedded/bin/any23server
any23server.bat
file if you are using Windows"$REPO"
into %REPO%
twice (line #79 in any23server.bat
file) if Error: Unable to access jarfile $REPO/jetty-runner-8.1.4.v20120524.jar.
message appears
RDF is a data model for which several syntaxes have been developed (see Section 5 in RDF Primer).
RDF document is an RDF graph (describing some objects) serialized into chosen representation/syntax.
During the previous lab, you created an RDF model/graph on a topic of your choice (The Bold and the Beautiful / The Game of Thrones / other).
During this lab, we will serialize it with the Turtle syntax (an RDF document will be created) and then extend it with some RDF Schema (RDFS) extras.
Let's start!
*.ttl
extension.@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix bb: <http://yourname/b-and-b#> .
@base <http://yourname/b-and-b/> .
#
symbol.<data><![CDATA[ … ]]></data>
(indentation may be changed)In the RDF there are two ways to describe a set or a sequence of objects:
rdf:List
).Important difference (see RDF 1.1 Semantics):
There is no way in RDF to assert that a container contains only a fixed number of members. This is a reflection of the fact that it is always consistent to add a triple to a graph asserting a membership property of any container. And finally, there is no built-in assumption that an RDF container has only finitely many members. […]
Collections differ from containers […] in having an explicit terminator, allowing applications to determine the exact set of items in the collection.
RDF allows the types of literals to be defined explicitely, making them easier to process later. The basic types are defined in the W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes recommendation.
# ... @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . # ... # ... <brooke-logan> <daughter-of> <beth-logan>; <born> "1900-01-01"^^xsd:date; <studied> "Chemistry"^^xsd:string; # ...
We are in the middle, so let's visualize our RDF files.
rdfxml
) formatCheck by Direct Input
field. Select Graph only
from dropdown list and click Parse RDF
.Semantic vocabularies are sets of predefined properties for describing some domains. Examples include:
@prefix dc: <http://purl.org/dc/elements/1.1/> . # Sect 3 in the document @prefix dcterms: <http://purl.org/dc/terms/> . # Sect 2 in the document
# ... @prefix dc: <http://purl.org/dc/elements/1.1/>. @prefix dcterms: <http://purl.org/dc/terms/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix fhkb: <http://www.example.com/genealogy.owl#> . # ... # ... <brooke-logan> fhkb:isDaughterOf <beth-logian>; <born> "1900-01-01"^^xsd:date; <studied> "Chemistry"^^xsd:string; foaf:name "Brooke Logan", "Brooke Forrester", "Brooke Chambers", "Brooke Jones", "Brooke Marone", "Brooke Spencer". # ...
RDF Schema allows to organize objects into classes and define simple taxonomies.
@base <http://kkutt/got/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <Character> rdf:type rdfs:Class . <Dwarf> rdf:type rdfs:Class ; rdfs:subClassOf <Character> . foaf:Person rdfs:subClassOf <Character> .
rdf:type
statements to your RDF file, e.g.: <brooke-logan> a foaf:Person . <tyrion-lannister> rdf:type <Dwarf> .
a
is an alias for rdf:type
so two statements: <tyrion-lannister> rdf:type <Dwarf> .
<tyrion-lannister> a <Dwarf> .
are equivalent.
RDF Schema also provides a way to define Properties as well as their domains and ranges.
<brooke-logan> fhkb:isDaughterOf <beth-logian>; <born> "1900-01-01"^^xsd:date; <studied> "Chemistry"^^xsd:string; foaf:name "Brooke Logan", "Brooke Forrester", "Brooke Chambers", "Brooke Jones", "Brooke Marone", "Brooke Spencer".
<studied>
is not defined in external dictionary – it is defined in our own namespace.
@base <http://kkutt/b-and-b/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . <studied> rdf:type rdfs:Property ; rdfs:domain foaf:person ; rdfs:range rdfs:Literal.
RDF Schema also provides some handful properties that are not used in inference process. These are:
rdfs:label
– used by convention to provide a human-readable name that is displayed by semantic web agents,rdfs:seeAlso
– cross-referencing; provide links to supplementary information,rdfs:isDefinedBy
– subPropertyOf rdfs:seeAlso; provides a link to the primary source of information,rdfs:comment
– for everything you want .Reading:
Common vocabularies:
Tools:
Others: