Please disable Adblockers and enable JavaScript for domain CEWebS.cs.univie.ac.at! We have NO ADS, but they may interfere with some of our course material.
[Info]
Simple_Example
Example ontology in Turtle syntax:
@prefix myPrefix: <http://myOntology.at/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
myPrefix:Austria a myPrefix:Country.
myPrefix:Germany a myPrefix:Country.
myPrefix:Vienna a myPrefix:City.
myPrefix:Munich a myPrefix:City.
myPrefix:Person1 a foaf:Person.
myPrefix:Person2 a foaf:Person.
myPrefix:Vienna myPrefix:is_in myPrefix:Austria.
myPrefix:Munich myPrefix:is_in myPrefix:Germany.
myPrefix:Person1 myPrefix:lives_in myPrefix:Austria;
foaf:firstName "Max";
foaf:lastName "Mustermann".
myPrefix:Person2 myPrefix:lives_in myPrefix:Germany;
foaf:firstName "Anna";
foaf:lastName "Musterfrau".
Example SPARQL (can be executed with e.g., "roqet" - see «documentation»):
PREFIX : <http://myOntology.at/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?person
FROM <[name of your ontology file]>
WHERE {
?person a foaf:Person.
?person foaf:firstName "Max".
}
Letzte Änderung: 27.06.2021, 14:09 | 142 Worte