Semantics
MatthewJ.GrahamCACR
MethodsofComputationalScienceCaltech, 2011May10
matthew graham
semanticweb
ThefutureoftheInternet(Web3.0)
Decentralizedplatformfordistributedknowledge
A webofdatabases
Logicalpiecesofmeaningthatcanbemechanicallymanipulatedbyamachine
Vocabulariesformakingassertionsaboutthings
Dataconsistencyandinferencing
Smartapplications
matthew graham
smartapps
matthew graham
knowledgeasagraph
Informationisbestexpressedasalabelled, directedgraph(entity-attribute-valuedatamodel)
matthew graham
resourcedescriptionframework
W3C standardforencodingknowledge
A factisexpressedasa subject-predicate-object tripleorstatement:
1has Atomic Number57
Subjects, predicatesandobjectsaregivenasnamesforentities
NamesareURIs
Objectscanalsobegivenastextvalues, calledliteralvalues, whichmayormaynotbetypedusingXML Schemadatatypes
matthew graham
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
rdf/xml
Resourcenodes:• Statementsubjectsandobjects• Usuallyhaverdf:aboutattribute• Canonlycontainpropertynodes
Propertynodes:• Literalvalues• Referencetoanobjectresourceusingrdf:resourceattribute• Resourcenode
matthew graham
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
rdfa
Embedknowledgeinan(X)HTML document
Usesattributesapplicabletoallelements:
-- about-- rel and rev-- href, src and resource-- property-- content-- datatype-- typeof
matthew graham
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
linkeddata
A termcoinedbyTimBerners-Leewhooutlinedfourprinciples:
-- UseURIstoidentifythingsthatyouexposetotheWebasresources
-- UseHTTP URIssothatpeoplecanlocateandlookup(dereference)thesethings
-- ProvideusefulinformationabouttheresourcewhenitsURIisdereferenced
-- Includelinkstoother, relatedURIsintheexposeddata
matthew graham
linkeddataweb
matthew graham
linkeddataexamples
ListallepisodesoftheHBO televisionseries"TheSopranos"orderedbytheirair-date
Findtheofficialwebsitesofcompanieswithmorethan50000employees
FindmethingsclosetotheEiffelTower
DiscovernewdrugstotreatAlzheimer's:
-- Whatproteinsareinvolvedinsignaltransduction and arerelatedtopyramidalneurons?∗ Google: 223000hits, 0results∗ Linkedhealthcaredata: 32hits, 32results
matthew graham
linkeddatatools
Browsers:
-- Tabulator(alsohasFirefoxplugin)-- Disco-- OpenlinkDataBrowser
Libraries
-- SemanticWebClientLibrary(Java)
Exposingdata
-- d2rforexposingrelationaldatainadb
matthew graham
conceptschemes
controlledvocabulary: aclosedlistoftermsthatcanbeusedforclassification
taxonomy: acontrolledvocabularywithhierarchy(term-sub-term)
thesaurus: ataxonomywithbroader/narrowerterm,synonymousterm, topterm, scopenoteandrelatedterm
subjectheadinglist, terminology, glossary, facetedclassification
matthew graham
simpleknowledgeorganizationsystem
W3C standardforexpressingknowledgeconceptschemesinamachine-understandableway
SetofRDF propertiesandRDFS classestoexpressthecontentandstructureofaconceptschemeasanRDF graph:
• Collection • CollectableProperty • OrderedCollection• ConceptScheme • Concept• prefLabel • altLabel • hiddenLabel• definition • example • scopeNote• broader • narrower • related
matthew graham
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
sparqlprotocolandrdfquerylanguage
W3C standardforRDF querylanguageanddataaccessprotocol
SELECT,CONSTRUCT,ASK,DESCRIBE
WHERE,FILTER,OPTIONAL,UNION
ORDER BY,DISTINCT,REDUCED,LIMIT,OFFSET
matthew graham
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
ontologies
Anontologyisaformalspecificationofasharedconceptualization
-- itisadatamodelthatrepresentsasetofconceptswithinadomainandtherelationshipsbetweenthoseconcepts
Ontologiesgenerallydescribe:• Individuals: thebasicor"groundlevel"objects• Classes: sets, collections, ortypesofobjects• Attributes: properties, features, characteristics, orparametersthatobjectscanhaveandshare• Relations: waysthatobjectscanberelatedtooneanother• Events: thechangingofattributesorrelations
matthew graham
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
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
inferenceComputersprovidereasoningservicesoveraknowledgedomainwherethedomainandtheknowledgehavebeenformallyandrigorouslyspecifiedandreasoningalgorithmshavebeenimplementedinawaywhichthatcomputercanapply. Forexample:
Sheeponlyeatgrass
Grassisaplant
Plantsandpartsofplantsaredisjointfromanimalsandpartsofanimals
Vegetariansonlyeatthingswhicharenotanimalsorpartsofanimals
=>sheeparevegetarians!
matthew graham
inferenceexamples
relevanttermsforstage:
startsome(succeeded bysomestage1)andendsome(preceded bysomestage2)
relatedtermsforterm:
part ofsomeclass1ordevelops fromsomeclass1orhas partfromsomeclass1
lowestcommonancestor:
superclassOf(class1orclass2)
matthew graham
software
Jena(jena.sourceforge.net)
Protege(protege.stanford.edu)
cwm(www.w3.org/2000/10/swap/doc/cwm.html)
matthew graham