Semantic Web Technologies OWL Semantic Web Layers 5
Semantic Web Technologies OWL
Semantic Web - Layers 5 2 1 URIs. [ Τι είναι - διαφορά με URL ] 2 XML. [ Basics ] 3 RDF. [ Basics ] 4 RDF Schema. [ Basics ] 5 4 3 1 OWL. [ Αναλυτική παρουσίαση ]
Semantic web - XML Παράδειγμα 1 Παράδειγμα 2 <XML> <PERSON> <NAME>JOHN</NAME> <AGE>22</AGE> <PHONE>28210 -32432</PHONE> </PERSON> <IMAGE> <ID>IMG 1</ID> <TITLE>TREE</TITLE> <PATH>C: imagestree. jpg</PATH> <CAPTION>This is a tree</caption> </IMAGE> <PERSON> <NAME>GEORGE</NAME> <AGE>43</AGE> <PHONE>28210 -22332</PHONE> </PERSON> </XML> <IMAGE> <ID>IMG 2</ID> <TITLE>CAR</TITLE> <PATH>C: imagescar. jpg</PATH> <CAPTION>This is a car</caption> </IMAGE> </XML>
Semantic web - RDF • Τριπλέτες subject – predicate – object • Κάθε description element περιγράφει ένα resource. • Κάθε attribute ή Nested element σε ένα description tag είναι property του συγκεκριμένου resource.
Semantic web - RDF Παράδειγμα σύνταξης RDF: <rdf: Description rdf: about="some. uri/person/John"> <ex: has. Friend resource="some. uri/person/George"/> </rdf: Description> <rdf: Description rdf: about="some. uri/person/John"> <ex: has. Home. Page>http: //www. john. gr</ex: has. Home. Page> </rdf: Description> <rdf: Description rdf: about="some. uri/person/George"> <ex: has. Friend resource="some. uri/person/Tom"/> </rdf: Description>
Semantic web - RDF namespaces • Συντομογραφίες για τα resource identifiers για να γίνεται ποιο ευανάγνωστο ένα RDF Document. • <rdf: RDF xmlns: owl ="http: //www. w 3. org/2002/07/owl#" xmlns: rdf = “http: //www. w 3. org/1999/02/22 -rdf-syntax-ns#” xmlns: rdfs="http: //www. w 3. org/2000/01/rdf-schema#" xmlns: xsd ="http: //www. w 3. org/2001/XMLSchema#">
Semantic web - RDF schema • Μερικά RDF Schema terms : Class , Property , type , sub. Class. Of , range domain • Φτιάχνοντας τριπλέτες με αυτούς τους όρους: <Person, type, Class> <has. Friend, type, Property> <Professor, sub. Class. Of, Person> <John, type, Professor> <has. Friend, range, Person> <has. Friend, domain, Person>
Semantic web - RDF schema • Προβλήματα του RDF Schema : Αδυναμία να περιγράψει με περισσότερη λεπτομέρια τα resources : – No localised range and domain constraints • Πχ το range του has. Child είναι person για τους ανθρώπους και elephant για τους ελέφαντες. – No existence/cardinality constraints • Πχ. Ενας άνθρωπος έχει ακριβώς 2 γονείς. – No transitive, inverse or symmetrical properties • Can’t say that is. Part. Of is a transitive property, that has. Part is the inverse of is. Part. Of or that touches is symmetrical – Κτλ κτλ
OWL - Classes • owl: class είναι subclass του rdfs: class • Πολύ μεγαλύτερη εκφραστικότητα από rdfs: class <rdfs: Classrdf: ID=“Bear"> <rdfs: sub. Class. Of rdf: resource="#Animal"/> </rdfs: Class> <owl: Classrdf: ID=“Bear"> <rdfs: sub. Class. Of rdf: resource="#Animal"/> </owl: Class>
OWL - Classes • Intersection. Of : Χρησιμοποιώντας το μπορούμε να κατασκευάσουμε μια κλάση συνδέοντας την με μια άλλη ή με μια ιδιότητα. Παράδειγμα : Ο John Είναι ένα Intersection του Human και του male. <owl: Class rdf: ID=“John"> <owl: intersection. Of rdf: parse. Type="Collection"> <owl: Class rdf: about="#Human" /> <owl: Class rdf: about="#Male" /> </owl: intersection. Of> </owl: Class>
OWL - Classes • Complement. Of : Χρησιμοποιείται για να πάρουμε το συμπλήρωμα. Παράδειγμα : Alive είναι Complement. Of του Dead <owl: Class rdf: ID=“Alive"> <owl: complement. Of rdf: resource="#Dead" /> </owl: Class>
OWL - Classes • one. Of : Περιορίζουμε τα Instances τα οποία μπορούν να δημιουργηθούν για μια κλάση. Παράδειγμα : H κλάση Day_Of_Week <owl: Class rdf: ID=“Day_Of_Week"> <owl: one. Of rdf: parse. Type="Collection"> < Day_Of_Week rdf: about="http: //www. ex. com#Monday"/> < Day_Of_Week rdf: about="http: //www. ex. com#Tuesday"/> < Day_Of_Week rdf: about="http: //www. ex. com#Wednesday"/> … </owl: one. Of> </owl: Class>
OWL - Classes • dis. Joint. With : Oταν δυο κλάσεις δηλώνονται ως dis. Joint αυτό σημαίνει ότι εάν ένα individual ανήκει στη μια τότε δε μπορεί να ανήκει και στην άλλη. Παράδειγμα : Εάν ένα instance Ανήκει στην κλάση pasta δε μπορεί Να ανήκει και στις υπόλοιπες <owl: Class rdf: ID="Pasta"> <owl: disjoint. With rdf: resource="#Meat"/> <owl: disjoint. With rdf: resource="#Fowl"/> <owl: disjoint. With rdf: resource="#Seafood"/> <owl: disjoint. With rdf: resource="#Dessert"/> <owl: disjoint. With rdf: resource="#Fruit"/> </owl: Class>
OWL - Properties • Στην owl έχουμε 2 ειδών properties 1) Object properties 2) Datatype properties Τα object συσχετίζουν δύο resources ενώ τα datatype συσχετίζουν ένα resource με ένα literal ( string , value , date κτλ ) Και τα 2 είναι subclasses του rdf: property
OWL - Property Characteristics 1) Symmetric Παράδειγμα : X touches Y Y touches X X connects to Y Y connects to X <owl: Object. Property rdf: ID=“touches"> <rdf: type rdf: resource="http: //www. w 3. org/2002/07/owl#Symmetric. Property"/> <rdfs: domain rdf: resource="#Person"/> <rdfs: range rdf: resource="#Person"/> </owl: Object. Property>
OWL - Property Characteristics 2) Transitive Παράδειγμα : X includes Y , Y includes Z X includes Z Bear is an animal , Grizzly is a bear Grizzly is an animal <owl: Object. Property rdf: ID=“includes"> <rdf: type rdf: resource="http: //www. w 3. org/2002/07/owl#Transitive. Property"/> <rdfs: domain rdf: resource="#shape"/> <rdfs: range rdf: resource="#shape"/> </owl: Object. Property>
OWL - Functional Example RDF : Δεν μπορούμε να βρούμε ποιο από τα παρακάτω είναι αληθές. <Person rdf: about="http: //www. person. org#John"> <birthplace rdf: about="http: //www. country. org#USA"/> </Person> <Person rdf: about="http: //www. person. org#John"> <birthplace rdf: about="http: //www. country. org#GREECE"/> </Person> <Person rdf: about="http: //www. person. org#John"> <birthplace rdf: about="http: //www. country. org#GERMANY"/> </Person>
OWL - Functional Example Στην owl μπορούμε να λύσουμε το πρόβλημα ορίζοντας το birth. Place ως functional : <owl: Datatype. Property rdf: ID=“birth. Place"> <rdf: type rdf: resource="http: //www. w 3. org/2002/07/owl#Functional. Property"/> <rdfs: domain rdf: resource="#Person"/> <rdfs: range rdf: resource=“Country"/> </owl: Object. Property>
OWL – Cardinality restriction Εναλακτικά με τη δήλωση functional του property θα Μπορούσαμε να φτιάξουμε ένα cardinality restriction : <owl: Class rdf: ID=“Person"> <owl: Restriction> <owl: on. Property rdf: resource="#birth. Place"/> <owl: cardinality rdf: datatype="&xsd; non. Negative. Integer">1</owl: cardinality> </owl: Restriction> </owl: Class>
OWL - Property Characteristics 5) Inverse Καθορίζει την αντίστροφη σχέση. Παράδειγμα : Employee 1 worksfor Company 1 has. Employee 1 <owl: Object. Property rdf: ID=“works. For"> <owl: inverse. Of rdf: resource="#has. Employee"/> <rdfs: domain rdf: resource="#Employee"/> <rdfs: range rdf: resource="#Company"/> </owl: Object. Property>
OWL - Individuals • Individuals είναι τα instances των κλάσεων • Στην owl υπάρχουν κάποια statements που περιγράφουν σχέσεις ανάμεσα στα individuals. • Παρακάτω θα δουμε τα : same. Individual. As different. From all. Different
OWL - Individuals all. Different : Χρησιμοποιόντας το all. Different μπορούμε να δείξουμε ότι μια συλλογή από individuals είναι όλα διαφορετικά μεταξύ τους. Παράδειγμα: Ονόματα κακοποιών που έχουν ταυτοποιηθεί ότι είναι διαφορετικά πρόσωπα. <owl: All. Different> <owl: distinct. Members rdf: parse. Type="Collection"> <Criminal rdf: about="http: //www. fbi. com/criminals#Johnson"/> <Criminal rdf: about="http: //www. fbi. com/criminals#Jackson"/> <Criminal rdf: about="http: //www. fbi. com/criminals#Larson"/> <Criminal rdf: about="http: //www. fbi. com/criminals#Jeferson"/> </owl: distinct. Members> </owl: All. Different>
- Slides: 33