1 / 54

Aplicatii Web bazate pe semantica, agenti si servicii

http://turing.cs.pub.ro/webs_07. Aplicatii Web bazate pe semantica, agenti si servicii. Universitatea Politehnica Bucuresti Anul universitar 2007-2008, Master Adina Magda Florea. Curs 3. XML RDF OWL. 1. XML. Sintaxa care descrie continutul; elemente XML

tayte
Download Presentation

Aplicatii Web bazate pe semantica, agenti si servicii

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. http://turing.cs.pub.ro/webs_07 Aplicatii Web bazate pe semantica, agenti si servicii Universitatea Politehnica BucurestiAnul universitar 2007-2008, MasterAdina Magda Florea

  2. Curs 3 • XML • RDF • OWL

  3. 1. XML • Sintaxa care descrie continutul; elemente XML • Corespunde unui arbore. Un element are marcaje (taguri) de inceput si sfarsit • Elementele pot avea unul sau mai multe atribute, fiecare cu o valoare asociata <temperature scale="Celsius"> • Un document XML are un singur element de top-level • Restrictii • Fiecare element care incepe cu un tag trebuie sa se termine cu unul • nu pot exista 2 atribute cu acelasi nume intr-un element

  4. XML • XML defineste taguri specifice domeniului (spre deosebire de HTML – formatare) • Extensibilitate XML – orice vocabular specific domeniului poate fi construit • Nu este suficient pt a transmite semantica dar are potential in acest sens • Posibilitatea confuziei intre vocabulare => namespace

  5. Namespaces • Identificare corecta = plasarea elementelor si atributelor intr-un spatiu de nume diferit (namespace, prescurtat ns) • Un ns este identificat prin URL lui specificat in doc XML • Declaratia de ns leaga un prefix local la un URI a ns <?xml version="1.0"?> <weather xmlns="http://www.temperature.org" xmlns:places= "http://www.temperature.org/places" <temperature scale="Celsius"> <value> 25</value> <error> 2 </error> <temperature/> <places:latitude>33.23</places:latitude> <places:longitude>155.23</places:longitudine> </weather> ns implicit prefix in ns

  6. XML Schema • Descrie structura unui set de documente similare + elemente, atribute si valori implicite • Poate impune tipuri de date • O XML Schema este un document scris in XML care descrie structuri si valori permise pentru date valide XML (meta-document) • Un validator (XSV= XML Schema Validator) este un program care verifica un document XML daca este conform cu un XML Schema • xsd – XML Schema Definition • http://www.w3.org/2001/03/webdata/xsv

  7. 2. RDF • Ofera o baza pt reprezentarea cunostintelor • Un limbaj simplu format din asertiuni (instructiuni) care permite reprezentarea cunostintelor, de ex resurse • RDF utilizeaza idei din reprezentarea cunostintelor dar foloseste Web pt a face cunostintele larg disponibile

  8. De ce RDF? • XML • Specifica un arbore al documentului • Nu identifica continutul documentului • Permite reprezentari mltiple pentru acelasi continut • RDF exprima chiar continutul • RDF surprinde structura de esenta pe cand XML surprinde structura de suprafata • RDF descrie grafuri in general • Intelesul depinde de graf si nu de documentul care descrie graful

  9. Resurse si literali • RDF permite descrierea resurselor • O resursa este un obiect • pt care se poate da o descriere • este identificat printr-un URI dar si printr-o descriere abstracta (nu neaparat se mapeaza la o adresa de retea) • Ex: docs, imags, videoclips, services, unele in afara web (oameni, obiecte) • Resursele se mapeaza conceptual pe entitati • Un literal este ceva mai simplu • O valoare (string, integer, ..) • Nu i se poate da o descriere • exista literali cu tip: sirul + referinta URI la o XML Schema care descrie tipul

  10. Instructiuni sau triplete • RDF se bazeaza pe o gramatica simpla • Un document RDF este o multime de instructiuni sau triplete • Fiecare instructiune este formata din • Subiect: o resursa • Obiect: o resursa sau un literal • Predicat: o resursa (proprietate rdf:Property) • Subiectul este legat de obiect prin predicat (predicate binare)

  11. Sintaxa • In principiu, RDF nu este legat de XML, dar este cea mai comuna sintaxa • Foloseste sintaxa standard a namespace din XML • Namespaces definite de standardul RDF • Abreviate tipic prin rdf si rdfs • Conceptul de baza – identificarea resurselor rdf:ID • rdf:ID este interpretat ca un fragment de identificator relativ la URI de baza pentru contextul curent • O valoare rdf:ID precedata de # corespunde unui URI relativ care, apendat la URI de baza, creaza URI absolut

  12. Sintaxa • rdf:ID – introduce resursa ce se defineste • rdf:about – refera o resursa definita in alt loc • Se pot defini tipuri ale obiectelor prin rdf:type

  13. Exemplu (folosind Dublin Core) <?xml version='1.0' encoding='UTF-8'?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:Description rdf:about="http://www.wiley.com/SOC"> <dc:title>Service-Oriented Computing</dc:title> <dc:creator>Munindar</dc:creator> <dc:creator>Michael</dc:creator> <dc:publisher>Wiley</dc:publisher> </rdf:Description> </rdf:RDF> • rdf:Description grupeaza instructiuni despre un subiect Set de metadate pentru descrierea resurselor

  14. Reificare • Reificarea unui concept = posibilitatea de a-l referi • In RDF instructiunile sunt reificate pentru a permite altor instructiuni sa le refere • In acest scop se defineste rdf:Statement • Vazute ca resurse, toate instructiunile sunt de tipul • rdf:type rdf:Statement • Fiecare rdf:statement are 3 proprietati de baza: rdf:subject, rdf: object, rdf:predicate • Astfel se pot accesa cele 3 componente ale unei instructiuni • RDF – limbaj logic in care se pot exprima relatii binare si conjunctii (nu se pot exprima negatii si disjunctii) • Corespunde "exsitential-conjunctive logic"

  15. 3. OWL • Web Ontological Language – specifica clase si proprietati intr-o forma bazata pe DL • O ontologie defineste clase si relatii intre clase • OWL trebuie sa permita colectarea informatiilor din surse multiple • Aceasta este partial realizata prin posibilitatea de a importa ontologii • OWL – presupunerea lumii deschise • Descrierea resurselor nu este limitata la un fisier sau un context • Clasa C1 poate fi definita in ontologia O1 dar poate fi extinsa in alte ontologii • C1 monotona • Nu se pot retrage informatii • Pot fi contradictorii

  16. OWL • Definitii clase <owl:Class rdf:ID="Winery"/> <owl:Class rdf:ID="Region"/> <owl:Class rdf:ID="ConsumableThing"/> • Suporta superclase multiple <owl:Class rdf:ID="Mamifer"> <rdfs:subClassOf rdf:resource="#Animal"/> <rdfs:subClassOf rdf:resource="#Patruped"/> </owl:Class>

  17. OWL • O clasa este definita prin proprietatile ei • Proprietati – o relatie binara intre 2 clase definita pe baza de domeniu si codomeniu (range) <owl:objectPropery rdf:ID="areParinte"> <rdfs:domain rdf:resource="#Animal"/> <rdfs:range rdf:resource="#Animal"/> </owl:objectPropery> • O proprietate poate avea sub-proprietati • Un individ se defineste ca un obiect al clasei <Mamifer rdf:ID="Rodo"> <areParinte> <Animal rdf:ID="#Cleo"/></areParinte> </Mamifer>

  18. Namespaces • Declaratii de XML namespace care incep cu un tag rdf:RDF • Ofera modalitatea de a interpreta neambigu identificatori • O ontologie OWL tipica incepe cu o serie de declaratii de ns

  19. Declaratii • Document OWL – elementul de top level este rdf:RDF • Apoi se declara de obicei ns cheie: OWL, RDF, RDF Schema, XML Schema si alte ns specifice domeniului • Urmeaza o asertiune cu elementul owl:Ontology care specifica ca este vorba de o ontologie • Urmeaza codificarea versiunilor si eventual importarea altor ontologii

  20. Declaratii de namespaces <rdf:RDF xmlns ="http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#" xml:base ="http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#" xmlns:vin ="http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#" xmlns:food="http://www.w3.org/TR/2003/PR-owl-guide-20031215/food#" xmlns:owl ="http://www.w3.org/TR/owl-ref/#" xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd ="http://www.w3.org/2001/XMLSchema#"> • Primele doua declaratii – ns asociate cu aceasta ontologie • Declara default namespace, indicand faptul ca numele fara prefixuri se refera la ontologia curenta • Declaratia a 3a identifica ns al ontologiei curente cu prefixul vin http://www.w3.org/TR/owl-guide/

  21. Declaratii de namespaces <rdf:RDF xmlns ="http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#" xml:base ="http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#" xmlns:vin ="http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#" xmlns:food="http://www.w3.org/TR/2003/PR-owl-guide-20031215/food#" xmlns:owl ="http://www.w3.org/TR/owl-ref/#" xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd ="http://www.w3.org/2001/XMLSchema#"> • A 4a declaratie identifica ns ontologiei suport food cu prefixul food: • A 5a declaratie spune ca in acest document elementele prefixate de owl: trebuie intelese ca referind obiecte din ns numit http://www.w3.org/TR/owl-ref# • Aceasta este o declaratie OWL conventionala utilizata pentru a introduce vocabularul OWL

  22. Declaratii de namespaces <rdf:RDF xmlns ="http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#" xml:base ="http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#" xmlns:vin ="http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#" xmlns:food="http://www.w3.org/TR/2003/PR-owl-guide-20031215/food#" xmlns:owl ="http://www.w3.org/TR/owl-ref/#" xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd ="http://www.w3.org/2001/XMLSchema#"> • OWL depinde de constructii definite de tipurile de date din RDF, RDFS si XML Schema. In acest document, prefixul rdf: se refera la elemente din ns xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#" • Urmatoarele doua declaratii de ns spun acelasi lucru despre tipurile de date din RDF Schema (rdfs:) si cele din XML Schema (xsd:)

  23. Declararea entitatilor • In OWL referim (des) identificatorii utilizand valori de atribute. Acestea pot fi scrise complet, de exemplu: "http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#merlot" • sau utilizand abrevierile cu ajutorul definitiei unei entitati ENTITY, de exemplu: <!DOCTYPE rdf:RDF [ <!ENTITY vin "http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#" > <!ENTITY food "http://www.w3.org/TR/2003/PR-owl-guide-20031215/food#" > ]> • Dupa aceste definitii, putem scrie: "&vin;merlot" care se va expanda la: "http://www.w3.org/TR/2003/PR-owl-guide-20031215/wine#merlot"

  24. Header-ul ontologiei <owl:Ontology rdf:about=""> <rdfs:comment>An example OWL ontology</rdfs:comment> <owl:priorVersion rdf:resource="http://www.w3.org/TR/2003/CR-owl-guide-1a/wine"/> <owl:imports rdf:resource="http://www.w3.org/TR/2003/PR-owl-guide-1b/food"/> <rdfs:label>Wine Ontology</rdfs:label> ... </owl:Ontology> • owl:Ontology colecteaza meta-date despre ontologie • owl:imports include (importa) o ontologie referita (poate esua)

  25. Clase • Clasele definesc o multime de obiecte (instante) • Clasele OWL corespund conceptelor din DL • owl:Class– definita ca o subclasa a rdfs:Class • Toate clasele OWL sunt membrii ai owl:Class • O clasa predefinita owl:Thing este varful ierarhiei de clase (T) • owl:Nothing – predefinita: nu are instante, este o subclasa a oricarei clase ()

  26. Clase • Cateva exemple simple: <owl:Class rdf:ID="Winery"/> <owl:Class rdf:ID="Region"/> <owl:Class rdf:ID="ConsumableThing"/> • rdf:ID defineste numele clasei • In cadrul documentului Region poate fi referit astfel: • rdf:resource="#Region" • <rdf:about="#Winery"/> poate fi utilizat pentru a referi clasa "Winery" pentru extindere/rafinare

  27. Subclase • Subclasele introduc o relatie de subsumare <owl:Class rdf:ID="Pasta"> <rdfs:subClassOfrdf:resource="#ConsumableThing"/> ... </owl:Class> • In DL echivalent cu Pasta ConsumableThing • Rafinare <owl:Classrdf:about="Pasta"> <rdfs:subClassOf rdf:resource="#EdibleThing"/> ... </owl:Class> Pasta EdibleThing

  28. Indivizi • Descriu membrii ai clasei • Declaratie individ cu numele CentralCoastRegion ca un membru al clasei Region <Region rdf:ID="CentralCoastRegion"/> • CentralCoastRegion: Region • Aceasta este echivalent cu <owl:Thing rdf:ID="#CentralCoastRegion"> <rdf:type rdf:resource="#Region"/> </owl:Thing> • rdf:type este o proprietate RDF care leaga un individ de clasa in care este membru

  29. Indivizi <Region rdf:ID="SantaCruzMountainsRegion"> <locatedIn rdf:resource="#CaliforniaRegion"/> </Region> <Winery rdf:ID="SantaCruzMountainVineyard"/> <CabernetSauvignon rdf:ID="SantaCruzMountainVineyardCabernetSauvignon"> <locatedIn rdf:resource="#SantaCruzMountainsRegion"/> <hasMaker rdf:resource="#SantaCruzMountainVineyard"/> </CabernetSauvignon> <VintageYear rdf:ID="Year1998"> <yearValue rdf:datatype="&xsd;positiveInteger"> 1998 </yearValue> </VintageYear>

  30. Proprietati • Exista 2 tipuri de proprietati: • Proprietati obiect • instante a owl:ObjectProperty • leaga instantele a 2 clase • domeniul si codomeniul = o instanta a owl:Class si sunt owl:Thing (daca nu se specifica altfel) • Proprietati tip de date • instante a owl:DatatypeProperty • leaga instantele unei clase de instante ale unui tip de date • domeniul este la fel, codomeiul este o instanta a rdfs:DataType si este owl:DataRange • RDF rdf:Property (refera o proprietate ca un URI) – in OWL se separa pred(x,y) – x: inst clasa y: inst clasa pred(x,y) – x: inst clasa y: inst tip de date

  31. Proprietati obiect • O secventa de elemente OWL sunt legate (implicit) conjunctiv • Exemple proprietati obiect <owl:ObjectProperty rdf:ID="madeFromGrape"> <rdfs:domain rdf:resource="#Wine"/> <rdfs:range rdf:resource="#WineGrape"/> </owl:ObjectProperty> madeFromGrape.T Wine T madeFromGrape.WineGrape

  32. Proprietati si subproprietati • rdfs:subPropertyOf • rdfs:domain • rdfs:range • rdfs:equivalentProperty • rdfs:inverseOf – numai pt proprietati obiect <owl:ObjectProperty rdf:ID="livesIn"> <rdfs:domain rdf:resource="#Animal"/> <rdfs:range rdf:resource="#Location"/> <rdfs:subPropertyOf rdf:resource="#hasHabitat"/> <rdfs:equivalentProperty rdf:resource="#hasHome"/> </owl:ObjectProperty>

  33. hasColor hasWineDescriptor T hasColor.WineColor hasWineDescriptor WineDescriptor Wine hasColor WineColor Alt exemplu prop. obiect <owl:Class rdf:ID="WineDescriptor"/> <owl:Class rdf:ID="WineColor"> <rdfs:subClassOf rdf:resource="#WineDescriptor"/> ... </owl:Class> <owl:ObjectProperty rdf:ID="hasWineDescriptor"> <rdfs:domain rdf:resource="#Wine"/> <rdfs:range rdf:resource="#WineDescriptor"/> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="hasColor"> <rdfs:subPropertyOf rdf:resource="#hasWineDescriptor"/> <rdfs:domain rdf:resource="#Wine"/> <rdfs:range rdf:resource="#WineColor"/> </owl:ObjectProperty>

  34. Proprietati tip de date • Exprima relatii intre instante de clase, literali RDF si tipuri de date XML Schema • Toate masinile OWL trebuie sa suporte cel putin tipurile de date: • xsd:integer si xsd:string • Exemplu <owl:DatatypeProperty rdf:ID="yearValue"> <rdfs:domain rdf:resource="#VintageYear"/> <rdfs:range rdf:resource="&xsd;positiveInteger"/> </owl:DatatypeProperty> • yearValue leaga owl:Thing la valori intregi pozitive

  35. Constructori de clase • Cum se construieste o clasa? (a) Prin specificarea unui nume de clasa <owl:Class rdf:ID="WineDescriptor"/> (b) Prin specificarea nume clasa + descendenta <owl:Class rdf:ID="WineColor"> <rdfs:subClassOf rdf:resource="#WineDescriptor"/> </owl:Class> (c) combinatie de operatori logici: owl:IntersectionOf ( ), owl:unionOf ( ), owl:complementOf ( ) sau enumerareowl:oneOf (enumerare toti indivizii) Se foloseste in general cu tipul rdf:parseType='Collection' (d) Restrictii asupra proprietatilor = mecanism puternic

  36. Combinatie de operatori logici <owl:Class rdf:ID="WhiteBurgundy"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Burgundy"/> <owl:Class rdf:about="#WhiteWine"/> </owl:intersectionOf> </owl:Class> <owl:Class rdf:ID="WhiteWine"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Wine"/> <owl:Restriction> <owl:onProperty rdf:resource="#hasColor"/> <owl:hasValue rdf:resource="#White"/> </owl:Restriction> </owl:intersectionOf> </owl:Class>

  37. Combinatie de operatori logici <owl:Class rdf:ID="Fruit"> <owl:unionOf rdf:parseType="Collection"> <owl:Class rdf:about="#SweetFruit"/> <owl:Class rdf:about="#NonSweetFruit"/> </owl:unionOf> </owl:Class> Diferit de: <owl:Class rdf:ID="Fruit"> <rdfs:subClassOf rdf:resource="#SweetFruit"/> <rdfs:subClassOf rdf:resource="#NonSweetFruit"/> </owl:Class> care defineste Fruit ca intersectia intre SweetFruit si NonSweetFruit, care poate fi vida

  38. Combinatie de operatori logici <owl:Class rdf:ID="ConsumableThing"/> <owl:Class rdf:ID="NonConsumableThing"> <owl:complementOf rdf:resource="#ConsumableThing"/> </owl:Class> <owl:Class rdf:ID="NonFrenchWine"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Wine"/> <owl:Class> <owl:complementOf> <owl:Restriction> <owl:onProperty rdf:resource="#locatedIn"/> <owl:hasValue rdf:resource="#FrenchRegion"/> </owl:Restriction> </owl:complementOf> </owl:Class> </owl:intersectionOf> </owl:Class>

  39. Enumerare <owl:Class rdf:ID="WineColor"> <rdfs:subClassOf rdf:resource="#WineDescriptor"/> <owl:oneOf rdf:parseType="Collection"> <owl:WineColor rdf:about="#White"/> <owl:WineColor rdf:about="#Rose"/> <owl:WineColor rdf:about="#Red"/> </owl:oneOf> </owl:Class>

  40. Restrictii • Construirea claselor pe baza restrictiilor aplicate proprietatilor • Obiectele are satisfac restrictia asupra proprietatii (proprietatilr formeaza o clasa anonima • owl:Restriction – subclasa a owl:Class • O restrictie poate fi de 2 tipuri • owl:ObjectRestriction – se aplica pe o proprietate obiect • owl:dataRestriction – se aplica pe o proprietate tip de date • Proprietatea asupra careia se aplica restrictia este specificata prin owl:Property • owl:someValuesFrom • owl:hasValue • owl:minCardinality • owl:maxCardinality

  41. Wine Food:PotableLiquid ≥1 madeFromGrape Restrictii <owl:Class rdf:ID="Wine"> <rdfs:subClassOf rdf:resource="&food;PotableLiquid"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#madeFromGrape"/> <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger"> 1 </owl:minCardinality> </owl:Restriction> </rdfs:subClassOf> ... </owl:Class> • Zona verde defineste o clasa anionima care reprezinta lucrurile ce au o proprietate madeFromGrape (apar in cel putin o astfel de proprietate) • Definitia clasei Wine spune ca lucrurile care sunt Wine sunt de asemenea membrii ai acestei clase anonime • Fiecare individ Wine trebuie sa participe in cel putin o relatie madeFromGrape

  42. USACompany Company locatedIn:USA Restrictii <owl:Class rdf:ID="USACompany"> <rdfs:subClassOf rdf:resource="#Company"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#locatedIn"/> <owl:hasValue rdf:resource="#USA"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class>

  43. Restrictii <owl:Class rdf:ID="EuropeanCompany"> <rdfs:subClassOf rdf:resource="#Company"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#locatedIn"/> <owl:someValuesFrom rdf:resource="#EuropeanCountry"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class> EuropeanCompany Company locatedIn.EuropeanCountry

  44. Constructori de clase

  45. Exemplu <owl:Class> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Person"/> <owl:Restriction> <owl:onProperty rdf:resource="#hasChild"/> <owl:allValuesFrom> <owl:unionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Doctor"/> <owl:Restriction> <owl:onProperty rdf:resource="#hasChild"/> <owl:someValuesFrom rdf:resource="#Doctor"/> </owl:Restriction> </owl:unionOf> </owl:allValuesFrom> </owl:Restriction> </owl:intersectionOf> </owl:Class> Person hasChild.(Doctor  hasChild.Doctor)

  46. Axiome Clase Indivizi Proprietati

  47. Specii OWL • OWL Lite – in principal ierarhii si restrictii smple • e.g., cardinalitati numai 0 or 1, fara disjunctii • OWL DL – expresivitate maxima dar pastrand completitudinea calcului si decidabilitate • OWL Full – libertatea sintactica a RDF fara garantii computationale • e.g., in OWL Full o clasa poate fi tratata simultan ca o colectie de indivizi si ca un individ

  48. Exemplu ontologie OWL • Studentii opteaza pt cursuri, cursurile sunt oferite de departamente (unic), CS este un departament, un student trebuie sa urmeze cel putin un curs, un student full-time trebuie sa umeze intre 3 si 5 cursuri, un student full-time la CS <owl:Class rdf:ID="Student"/> <owl:Class rdf:ID="Course"/> <owl:Class rdf:ID="Department"/> <Department rdf:ID="CS"/>

  49. Exemplu ontologie OWL <owl:ObjectProperty rdf:ID="takes"> <rdfs:domain rdf:resource="#Student"/> <rdfs:range rdf:resource="#Course"/> </owl:ObjectProperty> <owl:Restriction> <owl:onProperty rdf:resource="#takes"/> <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger"> 1 </owl:minCardinality> </owl:Restriction> • O clasa anonima in care membrii urmeaza cel putin un curs. Stiind ca domeiul este Student se poate infera ca este o subclasa a Student. • Nu se spune insa ca toti studentii urmeaza cel putin un curs!

  50. Student <owl:Class rdf:about="Student"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#takes"/> <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger"> 1 </owl:minCardinality> </owl:Restriction> </rdfs:subClassOf> </owl:Class>

More Related