semantics - california institute of technologygeorge/aybi199/graham_semantics.… · semantics...

25
Semantics Matthew J. Graham CACR Methods of Computational Science Caltech, 2011 May 10 matew graham

Upload: others

Post on 21-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

Semantics

MatthewJ.GrahamCACR

MethodsofComputationalScienceCaltech, 2011May10

matthew graham

Page 2: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

semanticweb

ThefutureoftheInternet(Web3.0)

Decentralizedplatformfordistributedknowledge

A webofdatabases

Logicalpiecesofmeaningthatcanbemechanicallymanipulatedbyamachine

Vocabulariesformakingassertionsaboutthings

Dataconsistencyandinferencing

Smartapplications

matthew graham

Page 3: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

smartapps

matthew graham

Page 4: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

knowledgeasagraph

Informationisbestexpressedasalabelled, directedgraph(entity-attribute-valuedatamodel)

matthew graham

Page 5: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

resourcedescriptionframework

W3C standardforencodingknowledge

A factisexpressedasa subject-predicate-object tripleorstatement:

1has Atomic Number57

Subjects, predicatesandobjectsaregivenasnamesforentities

NamesareURIs

Objectscanalsobegivenastextvalues, calledliteralvalues, whichmayormaynotbetypedusingXML Schemadatatypes

matthew graham

Page 6: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

n3/turtle

URIsareexpressedas<. . . >orabbreviatedwithnamespaces

StatementisjustwrittenassubjectURI,predicateURI andobjectURI/literalvaluewithaperiod:

@prefix pt: <http://www.example.org/PeriodicTable#> .<http://www.example.org/PeriodicTable#La> pt:name "lanthanum" .

Multiplestatementswiththesamesubject(andpredicate)canbegroupedtogetherwithasemicolon(commas)

<http://www.example.org/PeriodicTable#La> pt:name "lanthanum" ;pt:atomicNumber 57 ; pt:color "silvery white" .

matthew graham

Page 7: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

rdf/xml

Resourcenodes:• Statementsubjectsandobjects• Usuallyhaverdf:aboutattribute• Canonlycontainpropertynodes

Propertynodes:• Literalvalues• Referencetoanobjectresourceusingrdf:resourceattribute• Resourcenode

matthew graham

Page 8: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

rdf/xmlexample

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:pt="http://www.example.org/PeriodicTable#">

<rdf:Description rdf:about="http://www.example.org/PeriodicTable#La"><pt:name> lanthanum <pt:name><pt:atomicNumber> 57 </pt:atomicNumber><pt:color> silvery white </pt:color>

</rdf:Description></rdf:RDF>

Forcomparison:

@prefix pt: <http://www.example.org/PeriodicTable#> .<http://www.example.org/PeriodicTable#La> pt:name "lanthanum" ;

pt:atomicNumber 57 ; pt:color "silvery white" .

matthew graham

Page 9: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

rdfa

Embedknowledgeinan(X)HTML document

Usesattributesapplicabletoallelements:

-- about-- rel and rev-- href, src and resource-- property-- content-- datatype-- typeof

matthew graham

Page 10: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

rdfaexample

<html xmlns="http://www.w3.org/1999/xhtml"xmlns:pt="http://www.example.org/PeriodicTable#">

<head><title> Lanthanum </title><base href="http://www.example.org/PeriodicTable#La" />

</head><body>

<p>The element <span property="pt:name"> lanthanum </span> has an atomicweight of <span property="pt:atomicWeight"> 57 </span> and is<span property="pt:color"> silvery white </span> in color.

</p></body>

</html>

matthew graham

Page 11: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

linkeddata

A termcoinedbyTimBerners-Leewhooutlinedfourprinciples:

-- UseURIstoidentifythingsthatyouexposetotheWebasresources

-- UseHTTP URIssothatpeoplecanlocateandlookup(dereference)thesethings

-- ProvideusefulinformationabouttheresourcewhenitsURIisdereferenced

-- Includelinkstoother, relatedURIsintheexposeddata

matthew graham

Page 12: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

linkeddataweb

matthew graham

Page 13: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

linkeddataexamples

ListallepisodesoftheHBO televisionseries"TheSopranos"orderedbytheirair-date

Findtheofficialwebsitesofcompanieswithmorethan50000employees

FindmethingsclosetotheEiffelTower

DiscovernewdrugstotreatAlzheimer's:

-- Whatproteinsareinvolvedinsignaltransduction and arerelatedtopyramidalneurons?∗ Google: 223000hits, 0results∗ Linkedhealthcaredata: 32hits, 32results

matthew graham

Page 14: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

linkeddatatools

Browsers:

-- Tabulator(alsohasFirefoxplugin)-- Disco-- OpenlinkDataBrowser

Libraries

-- SemanticWebClientLibrary(Java)

Exposingdata

-- d2rforexposingrelationaldatainadb

matthew graham

Page 15: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

conceptschemes

controlledvocabulary: aclosedlistoftermsthatcanbeusedforclassification

taxonomy: acontrolledvocabularywithhierarchy(term-sub-term)

thesaurus: ataxonomywithbroader/narrowerterm,synonymousterm, topterm, scopenoteandrelatedterm

subjectheadinglist, terminology, glossary, facetedclassification

matthew graham

Page 16: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

simpleknowledgeorganizationsystem

W3C standardforexpressingknowledgeconceptschemesinamachine-understandableway

SetofRDF propertiesandRDFS classestoexpressthecontentandstructureofaconceptschemeasanRDF graph:

• Collection • CollectableProperty • OrderedCollection• ConceptScheme • Concept• prefLabel • altLabel • hiddenLabel• definition • example • scopeNote• broader • narrower • related

matthew graham

Page 17: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

skosexample<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:skos="http://www.w3.org/2004/02/skos/core#"xml:base="http://www.astro.physik.uni-goettingen.de/~hessman/rdf/IVOAT">

<skos:ConceptScheme rdf:about=""><skos:hasTopConcept rdf:resource="#temperatureScales"/>

</skos:ConceptScheme><skos:Concept rdf:about="#absoluteTemperatureScale">

<skos:prefLabel>absolute temperature scale</skos:prefLabel><skos:definition>absolute temperature scale</skos:definition><skos:broader rdf:resource="#temperatureScales"/><skos:narrower rdf:resource="#Kelvin"/><skos:related rdf:resource="#celsiusTemperatureScale"/><skos:related rdf:resource="#temperature"/>

</skos:Concept></rdf:RDF>

matthew graham

Page 18: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

sparqlprotocolandrdfquerylanguage

W3C standardforRDF querylanguageanddataaccessprotocol

SELECT,CONSTRUCT,ASK,DESCRIBE

WHERE,FILTER,OPTIONAL,UNION

ORDER BY,DISTINCT,REDUCED,LIMIT,OFFSET

matthew graham

Page 19: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

sparqlexamplePREFIX table: <http://www.example.org/PeriodicTable#>SELECT ?name ?symbol ?weight ?number ?colorFROM <http://www.example.org/PeriodicTable.owl>WHERE{

?uranium table:name "uranium".?uranium table:atomicWeight ?uraniumWeight.?element table:name ?name.?element table:symbol ?symbol.?element table:atomicWeight ?weight.?element table:atomicNumber ?number.OPTIONAL { ?element table:color ?color }.FILTER ( ?weight > ?uraniumWeight )

}ORDER BY ASC[?weight]

matthew graham

Page 20: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

ontologies

Anontologyisaformalspecificationofasharedconceptualization

-- itisadatamodelthatrepresentsasetofconceptswithinadomainandtherelationshipsbetweenthoseconcepts

Ontologiesgenerallydescribe:• Individuals: thebasicor"groundlevel"objects• Classes: sets, collections, ortypesofobjects• Attributes: properties, features, characteristics, orparametersthatobjectscanhaveandshare• Relations: waysthatobjectscanberelatedtooneanother• Events: thechangingofattributesorrelations

matthew graham

Page 21: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

webontologylanguage(owl)

W3C standardforauthoringontologies

BasedonRDF (OWL semanticallyextendsRDFS)

RegardedasoneofthefundamentaltechnologiesunderpinningtheSemanticWeb

OWL allowsdescriptionsof:

-- relationsbetweenclasses(e.g. disjointness)-- cardinality(e.g. "exactlyone")-- characteristicsofproperties(e.g. symmetry)-- enumeratedclasses

matthew graham

Page 22: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

owlcomponents

Dataisinterpretedas:

-- asetof individuals-- asetof propertyassertions relatingtheindividualstoeachother-- asetof axioms placingconstraintsonsetsofindividuals(classes)andthe

typesofrelationshipsallowedbetweenthem

Forexample, the family ontology:

-- "hasMother"isonlypresentbetweentwoindividualswhen"hasParent"isalsopresent

-- membersof"HasTypeOBlood"areneverrelatedvia"hasParent"tomembersof"HasTypeABBlood"

-- IfAda"hasMother"AnneandAdais"HasTypeOBlood"thenAnneisnot"HasTypeABBlood"

matthew graham

Page 23: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

inferenceComputersprovidereasoningservicesoveraknowledgedomainwherethedomainandtheknowledgehavebeenformallyandrigorouslyspecifiedandreasoningalgorithmshavebeenimplementedinawaywhichthatcomputercanapply. Forexample:

Sheeponlyeatgrass

Grassisaplant

Plantsandpartsofplantsaredisjointfromanimalsandpartsofanimals

Vegetariansonlyeatthingswhicharenotanimalsorpartsofanimals

=>sheeparevegetarians!

matthew graham

Page 24: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

inferenceexamples

relevanttermsforstage:

startsome(succeeded bysomestage1)andendsome(preceded bysomestage2)

relatedtermsforterm:

part ofsomeclass1ordevelops fromsomeclass1orhas partfromsomeclass1

lowestcommonancestor:

superclassOf(class1orclass2)

matthew graham

Page 25: Semantics - California Institute of Technologygeorge/aybi199/Graham_Semantics.… · Semantics Matthew J. Graham CACR Methods of Computational Science Caltech,2011 May 10 matthew

software

Jena(jena.sourceforge.net)

Protege(protege.stanford.edu)

cwm(www.w3.org/2000/10/swap/doc/cwm.html)

matthew graham