




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
IntroductiontotheSemanticWeb
(tutorial)
LiangHong
hong@Introduction1.Introduction2.TheBasis:RDF/RDFSchema3.HowtogetRDFData4.LinkingData5.QueryRDFData6.Ontologies(OWL)7.ConclusionsLet’sorganizeatriptoBudapestfromAmsterdamusingtheWeb!Youtrytofindaproperflightwith……abig,reputableairline,or……theairlineofthetargetcountry,or……oralowcostoneYouhavetofindahotel,soyoulookfor……areallycheapaccommodation,or……orareallyluxuriousone,or……anintermediateone…oops,thatisnogood,thepageisinHungarianthatalmostnobodyunderstands,but……thisonecouldworkOfcourse,youcoulddecidetotrustaspecializedsite……likethisone,or……orthisoneYoumaywanttoknowsomethingaboutBudapest;lookforsomephotographs……onflickr……onGoogle……oryoucanlookatmine…ora(social)travelsiteWhathappenedhere?Youhadtoconsultalargenumberofsites,alldifferentinstyle,purpose,possiblylanguage…YouhadtomentallyintegrateallthoseinformationtoachieveyourgoalsWeallknowthat,sometimes,thisisalongandtediousprocess!Allthosepagesareonlytipsofrespectiveicebergs:therealdataishiddensomewhereindatabases,XMLfiles,Excelsheets,
…youhaveonlyaccesstowhattheWebpagedesignersallowyoutoseeSpecializedsites(Expedia,TripAdvisor)doabitmore:theygatherandcombinedatafromothersources(usuallywiththeapprovalofthedataowners)buttheystillcontrolhowyouseethosesourcesButsometimesyouwanttopersonalize:accesstheoriginaldataandcombineityourself!Hereisanotherexample…Anotherexample:socialsites.Ihavealistof“friends”by……Dopplr,…Twine,…LinkedIn,…and,ofcourse,FacebookIhadtotypeinandconnectwithfriendsagainandagainforeachsiteindependentlyThisisevenworsethenbefore:Ifeedtheicebergs,butIstilldonothaveaneasyaccesstodata…Putitanotherway…WewouldliketoextendthecurrentWebtoa“Webofdata”:allowforapplicationstoexploitthedatadirectlyWhatwouldweliketohave?UsethedataontheWebthesamewayaswedowithdocuments:beabletolinktodata(independentlyoftheirpresentation)usethatdatathewayIwant(presentit,mineit,etc)agents,programs,scripts,etc,shouldbeabletointerpretpartofthatdataButwait!Isn’twhatmashupsitesarealreadydoing?A“mashup”example:Insomeways,yes,andthatshowsthehugepowerofwhatsuchWebofdataprovidesButmashupsitesareforcedtodoveryad-hocjobsvariousdatasourcesexposetheirdataviaWebServiceseachwithadifferentAPI,adifferentlogic,differentstructurethesesitesareforcedtoreinventthewheelmanytimesbecausethereisnostandardwayofdoingthingsAnotherExample--FreebaseAFreebasegraphisanentitygraphofpeople,placesandthings,builtbyacommunitythatlovesopendata.Examples:“Findingallactornameswhowerebornin1950”?ItishardtogetanswerstothisqueryinWiki,sinceWikiisnotstructural-data.ThedatainFreebaseisstructured(inSematicWebDatamodel),whichcanbeassesseddirectly.AnotherExample—UsingFreebaseinWSJPutitanotherway(again)…WewouldliketoextendthecurrentWebtoastandardwayfora“Webofdata”Butwhatdoesthismean?Whatmakesthecurrent(document)Webwork?peoplecreatedifferentdocumentstheygiveanaddresstoit(ie,aURI)andmakeitaccessibletoothersontheWebSteven’ssiteonAmsterdam
(doneforsomevisitingfriends)Thensomemagichappens…OthersdiscoverthesiteandtheylinktoitThemoretheylinktoit,themoreimportantandwellknownthepagebecomesremember,thisiswhat,eg,Googleexploits!Thisisthe“Networkeffect”:somepagesbecomeimportant,andothersbegintorelyoniteveniftheauthordidnotexpectit…Thiscouldbeexpected…butthisone,fromtheothersideoftheGlobe,wasnot…WhatwouldthatmeanforaWebofData?Lessonslearned:weshouldbeableto:“publish”thedatatomakeitknownontheWebstandardwaysshouldbeusedinsteadofad-hocapproachestheanalogousapproachtodocuments:giveURI-stothedatamakeitpossibleto“l(fā)ink”tothatURIfromothersourcesofdata(notonlyWebpages)ie,applicationsshouldnotbeforcedtomaketargeteddevelopmentstoaccessthedatageneric,standardapproachesshouldsufficeandletthenetworkeffectworkitsway…ButitisalittlebitmorecomplicatedOnthetraditionalWeb,humansareimplicitlytakenintoaccountAWeblinkhasa“context”thatapersonmayuseEg:addressfieldonmypage:…leadingtothispageAhumanunderstandsthatthisismyinstitution’shomepageHe/sheknowswhatitmeans(realizesthatitisaresearchinstituteinAmsterdam)OnaWebofData,somethingismissing;machinescan’tmakesenseofthelinkaloneNewlessonlearned:extrainformation(“l(fā)abel”)mustbeaddedtoalink:“thislinkstomyinstitution,whichisaresearchinstitute”thisinformationshouldbemachinereadablethisisacharacterization(or“classification”)ofboththelinkanditstargetinsomecases,theclassificationshouldallowforsomelimited“reasoning”LetusputittogetherWhatweneedforaWebofData:useURI-stopublishdata,notonlyfulldocumentsallowthedatatolinktootherdatacharacterize/classifythedataandthelinks(the“terms”)toconveysomeextrameaningandusestandardsforallthese!現(xiàn)有的Web存在的問題:1.高匹配,低精度2.檢索詞對于詞匯高度敏感3.檢索的結(jié)果是單一的網(wǎng)頁解決的途徑:1.人工智能+計算語言學(xué)2.語義網(wǎng)SowhatistheSemanticWeb?Itis,essentially,theWebofData.
“SemanticWebTechnologies”isacollectionofstandardtechnologiestorealizeaWebofDataItisthatsimple…Ofcourse,thedevilisinthedetailsacommonmodelhastobeprovidedformachinestodescribe,query,etc,thedataandtheirconnectionsthe“classification”ofthetermscanbecomeverycomplexforspecificknowledgeareas:thisiswhereontologies,thesauri,etc,enterthegame…Inwhatfollows…WewilluseasimplisticexampletointroducethemaintechnicalconceptsThedetailswillbeforlaterduringthecourseTheroughstructureofdataintegrationMapthevariousdataontoanabstractdatarepresentationmakethedataindependentofitsinternalrepresentation…MergetheresultingrepresentationsStartmakingqueriesonthewhole!queriesthatcouldnothavebeendoneontheindividualdatasetsAsimplifiedbookstoredata(dataset“A”)1st:exportyourdataasasetofrelationsSomenotesontheexportingthedataRelationsformagraphthenodesrefertothe“real”dataorcontainsomeliteralhowthegraphisrepresentedinmachineisimmaterialfornowDataexportdoesnotnecessarilymeanphysicalconversionofthedatarelationscanbegeneratedon-the-flyatquerytimeviaSQL“bridges”scrapingHTMLpagesextractingdatafromExcelsheetsetc.OnecanexportpartofthedataAnotherbookstoredata(dataset“F”)2nd:exportyoursecondsetofdata3rd:startmergingyourdata3rd:startmergingyourdata(cont.)3rd:mergeidenticalresourcesStartmakingqueries…Userofdata“F”cannowaskquerieslike:“givemethetitleoftheoriginal”Thisinformationisnotinthedataset“F”……butcanberetrievedbymergingwithdataset“A”!However,morecanbeachieved…We“feel”thata:authorandf:auteurshouldbethesameButanautomaticmergedoestnotknowthat!Letusaddsomeextrainformationtothemergeddata:a:authorsameasf:auteurbothidentifya“Person”atermthatacommunitymayhavealreadydefined:a“Person”isuniquelyidentifiedbyhis/hernameand,say,homepageitcanbeusedasa“category”forcertaintypeofresources3rdrevisited:usetheextraknowledgeStartmakingricherqueries!Userofdataset“F”cannowquery:well…“givemethehomepageoftheoriginal’s‘a(chǎn)uteur’”Theinformationisnotindatasets“F”or“A”……butwasmadeavailableby:mergingdatasets“A”anddatasets“F”addingthreesimpleextrastatementsasanextra“glue”CombinewithdifferentdatasetsUsing,e.g.,the“Person”,thedatasetcanbecombinedwithothersourcesForexample,datainWikipediacanbeextractedusingdedicatedtoolse.g.,the“dbpedia”projectcanextractthe“infobox”informationfromWikipediaalready…MergewithWikipediadataMergewithWikipediadataMergewithWikipediadataIsthatsurprising?Itmaylooklikeitbut,infact,itshouldnotbe…WhathappenedviaautomaticmeansisdoneeverydaybyWebusers!Thedifference:abitofextrarigoursothatmachinescoulddothis,tooWhatdidwedo?Wecombineddifferentdatasetsthataresomewhereonthewebareofdifferentformats(mysql,excelsheet,XHTML,etc)havedifferentnamesforrelationsWecouldcombinethedatabecausesomeURI-swereidentical(theISBN-sinthiscase)Wecouldaddsomesimpleadditionalinformation(the“glue”),possiblyusingcommonterminologiesthatacommunityhasproducedAsaresult,newrelationscouldbefoundandretrievedItcouldbecomeevenmorepowerfulWecouldaddextraknowledgetothemergeddatasetse.g.,afullclassificationofvarioustypesoflibrarydatageographicalinformationetc.Thisiswhereontologies,extrarules,etc,comeinontologies/rulesetscanberelativelysimpleandsmall,orhuge,oranythinginbetween…EvenmorepowerfulqueriescanbeaskedasaresultWhatdidwedo?(cont)TheBasis:RDF
ResourceDescriptionFrameworkRDFtriplesLetusbegintoformalizewhatwedid!we“connected”thedata…butasimpleconnectionisnotenough…datashouldbenamedsomehowhencetheRDFTriples:alabelledconnectionbetweentworesourcesRDFtriples(cont.)AnRDFTriple(s,p,o)issuchthat:“s”,“p”areURI-s(UniformResourceIdentifier),ie,resourcesontheWeb;“o”isaURIoraliteral“s”,“p”,and“o”standfor“subject”,“property”,and“object”hereisthecompletetriple:RDFisageneralmodelforsuchtriples(withmachinereadableformatslikeRDF/XML,Turtle,N3,RXR,…)
(<http://…isbn…6682>,<http://…/original>,<http://…isbn…409X>)RDFtriples(cont.)ResourcescanuseanyURI,e.g.:(home)
(//q[@a=b])URI-scanalsodenotenonWebentities:ismenotmyhomepage,notmypublicationlist,butmeRDFtriplesformadirected,labelledgraphAsimpleRDFexample(inRDF/XML)<rdf:Descriptionrdf:about="http://…/isbn/2020386682"><f:titrexml:lang="fr">Lepalaisdesmirroirs</f:titre><f:originalrdf:resource="http://…/isbn/000651409X"/></rdf:Description>(Note:namespacesareusedtosimplifytheURI-s)AsimpleRDFexample(inTurtle)<http://…/isbn/2020386682>f:titre"Lepalaisdesmirroirs"@fr;f:original<http://…/isbn/000651409X>.RDF的基本概念資源Resource:可以將資源視為一個對象,也就是所要談?wù)摰降摹笆挛铩?。資源用URI來標(biāo)識!屬性Property:屬性是一類特殊的資源,描述資源之間的關(guān)系。屬性也是由URI來標(biāo)識,這樣使得用戶有了一個全球通用的唯一命名系統(tǒng)。
Example:FOAF稱述Statement:稱述用于描述資源所具有的屬性。一個稱述由一個“<S,P,O>”的三元組來標(biāo)識?!癐nternal”nodesConsiderthefollowingstatement:“thepublisherisa?thing?thathasanameandanaddress”Untilnow,nodeswereidentifiedwithaURI.But……whatistheURIof?thing??Internalidentifier(“blanknodes”)SyntaxisserializationdependentA234isinvisiblefromoutside(itisnota“real”URI!);itisaninternalidentifierforaresource<rdf:Descriptionrdf:about="http://…/isbn/000651409X"><a:publisherrdf:nodeID="A234"/></rdf:Description><rdf:Descriptionrdf:nodeID="A234"><a:p_name>HarpersCollins</a:p_name><a:city>HarpersCollins</a:city></rdf:Description><http://…/isbn/2020386682>a:publisher_:A234._:A234a:p_name"HarpersCollins".Blanknodes:thesystemcanalsodoitLetthesystemcreatea“nodeID”internally(youdonotreallycareaboutthename…)<rdf:Descriptionrdf:about="http://…/isbn/000651409X"><a:publisher><rdf:Description><a:p_name>HarpersCollins</a:p_name>…</rdf:Description></a:publisher></rdf:Description>SameinTurtle<http://…/isbn/000651409X>a:publisher[a:p_name"HarpersCollins";…].Blanknodes:somemoreremarksBlanknodesrequireattentionwhenmergingblanksnodeswithidenticalnodeID-sindifferentgraphsaredifferentimplementationsmustbecareful…ManyapplicationsprefernottouseblanknodesanddefinenewURI-s“on-the-fly”RDFinprogrammingpracticeForexample,usingJava+Jena(HP’sBristolLab):a“Model”objectiscreatedtheRDFfileisparsedandresultsstoredintheModeltheModeloffersmethodstoretrieve:triples(property,object)pairsforaspecificsubject(subject,property)pairsforspecificobjectetc.therestisconventionalprogramming…SimilartoolsexistinPython,PHP,etc.Jenaexample//createamodelModelmodel=newModelMem();Resourcesubject=model.createResource("URI_of_Subject")//'in'referstotheinputfilemodel.read(newInputStreamReader(in));StmtIteratoriter=model.listStatements(subject,null,null);while(iter.hasNext()){st=iter.next();p=st.getProperty();o=st.getObject();do_something(p,o);}MergeinpracticeEnvironmentsmergegraphsautomaticallye.g.,inJena,theModelcanloadseveralfilestheloadmergesthenewstatementsautomaticallyIntegrateknowledgeforChineseMedicineIntegrationofalargenumberofTCMdatabasesaround80databases,around200,000recordseachFormbasedqueryinterfaceforendusersCourtesyofHuajunChen,ZhejiangUniversity,(SWEOCaseStudy)IntegrateknowledgeforChineseMedicineOnelevelhigherup
(RDFS,Datatypes)NeedforRDFschemasFirststeptowardsthe“extraknowledge”:definethetermswecanusewhatrestrictionsapplywhatextrarelationshipsarethere?Officially:“RDFVocabularyDescriptionLanguage”theterm“Schema”isretainedforhistoricalreasons…Classes,resources,…Thinkofwellknowntraditionalontologiesortaxonomies:usetheterm“novel”“everynovelisafiction”“?TheGlassPalace?isanovel”etc.RDFSdefinesresourcesandclasses:everythinginRDFisa“resource”“classes”arealsoresources,but……theyarealsoacollectionofpossibleresources(i.e.,“individuals”)“fiction”,“novel”,…Classes,resources,…(cont.)Relationshipsaredefinedamongclassesandresources:“typing”:anindividualbelongstoaspecificclass“?TheGlassPalace?isanovel”tobemoreprecise:“??isanovel”“subclassing”:allinstancesofonearealsotheinstancesoftheother(“everynovelisafiction”)RDFSformalizesthesenotionsinRDFClasses,resourcesinRDF(S)RDFSdefinesthemeaningoftheseterms(theseareallspecialURI-s,wejustusethenamespaceabbreviation)SchemaexampleinRDF/XMLTheschemapart:<rdf:Descriptionrdf:ID="Novel"><rdf:typerdf:resource=""/></rdf:Description>TheRDFdataonaspecificnovel:<rdf:Descriptionrdf:about="http://…/isbn/000651409X"><rdf:typerdf:resource="http://…/bookSchema.rdf#Novel"/></rdf:Description>FurtherremarksontypesAresourcemaybelongtoseveralclassesrdf:typeisjustaproperty…“?TheGlassPalace?isanovel,but?TheGlassPalace?isalsoan?inventoryitem?…”i.e.,itisnotlikeadatatype!Thetypeinformationmaybeveryimportantforapplicationse.g.,itmaybeusedforacategorizationofpossiblenodesprobablythemostfrequentlyusedRDFproperty…(rememberthe“Person”inourexample?)InferredpropertiesisnotintheoriginalRDFdata……butcanbeinferredfromtheRDFSrulesRDFSenvironmentsreturnthattriple,too (<http://…/isbn/000651409X>rdf:type#Fiction)Inference:letusbeformal…TheRDFSemanticsdocumenthasalistof(33)entailmentrules:“ifsuchandsuchtriplesareinthegraph,addthisandthis”dothatrecursivelyuntilthegraphdoesnotchangeTherelevantruleforourexample:If:uuurdfs:subClassOfxxx.vvvrdf:typeuuu.Thenadd:vvvrdf:typexxx.PropertiesPropertyisaspecialclass(rdf:Property)propertiesarealsoresourcesidentifiedbyURI-sThereisalsoapossibilityfora“sub-property”allresourcesboundbythe“sub”arealsoboundbytheotherRangeanddomainofpropertiescanbespecifiedi.e.,whattypeofresourcesserveasobjectandsubjectPropertyspecificationserializedInRDF/XML:<rdf:Propertyrdf:ID="title"><rdfs:domainrdf:resource="#Fiction"/><rdfs:rangerdf:resource=""/></rdf:Property>InTurtle::titlerdf:typerdf:Property;rdfs:domain:Fiction;rdfs:rangerdfs:Literal.Whatdoesthismean?Again,newrelationscanbededuced.Indeed,if:titlerdf:typerdf:Property;rdfs:domain:Fiction;rdfs:rangerdfs:Literal.<http://…/isbn/000651409X>:title"TheGlassPalace".thenthesystemcaninferthat:<http://…/isbn/000651409X>rdf:type:Fiction.LiteralsLiteralsmayhaveadatatypefloats,integers,booleans,etc,definedinXMLSchemasfullXMLfragments(Natural)languagecanalsobespecifiedExamplesfordatatypes<http://…/isbn/000651409X>:page_number"543"^^xsd:integer;:publ_date"2000"^^xsd:gYear;:price"6.99"^^xsd:float.AbitofRDFScantakeyoufar…Rememberthepowerofmerge?Wecouldhaveused,inourexample:f:auteurisasubpropertyofa:authorandviceversa
(althoughwewillseeotherwaystodothat…)Ofcourse,insomecases,morecomplexknowledgeisnecessary(seelater…)RDFSchema核心類:rdfs:Resource,所有資源的類rdfs:Class,所有類的類rdfs:Literal,所有文字(字符串)的類rdfs:Property,所有屬性的類rdf:Statement,所有具體化稱述的類RDFSchema1)用于定義關(guān)系的核心屬性:rdf:type,把一個資源和它的所屬的類聯(lián)系起來rdfs:subClassOf,把一個類和它的父類聯(lián)系起來rdfs:subPropertyOf,把一個屬性和它的一個父親屬性聯(lián)系起來2)用于定義關(guān)系的核心屬性:rdfs:domain,限定屬性P的定義域rdf:range,限定屬性P的值域例子<rdfs:Classrdf:about=“授課者”><rdfs:subClassOfrdf:resouce=“教工”/></rdfs:Class><rdf:Propertyrdf:ID=“電話號碼”><rdfs:domainrdf:resouce=“#教工”/><rdfs:rangerdf:resouce=“&rdf;Literal”/></rdf:Property>Univ.ofPlymouth’sresourcemanagementCourtesyofChrisClarke,Talis,andFionaGreig,UniversityofPlymouth(SWEOCaseStudy)Managesteachingmaterialsforstudents(includinginstructorannotations,bookmarks,A/V,…)quicklyadaptstochanges(eg,librarysubscriptions)usessimple(public)vocabulariestobinddatalinkstoexternaldatasetsHowtogetRDFData?
(Microformats,GRDDL,RDFa)SimpleapproachWriteRDF/XMLorTurtle“manually”Insomecasesthatisnecessary,butitreallydoesnotscale…RDFwithXHTMLObviously,ahugesourceofinformationByaddingsome“meta”information,thesamesourcecanbereusedfor,eg,dataintegration,bettermashups,etctypicalexample:yourpersonalinformation,likeaddress,shouldbereadableforhumansandprocessablebymachinesTwosolutionshaveemerged:extractthestructurefromthepageandconvertthecontentintoRDFaddRDFstatementsdirectlyintoXHTMLviaRDFaExtractRDFUseintelligent“scrapers”or“wrappers”toextractastructure(henceRDF)fromaWebpagesorXMLfiles……andthengenerateRDFautomatically(e.g.,viaanXSLTscript)119InformationExtraction(IE):TexttoRecordsMaxPlanck4/23,1858KielAlbertEinstein3/14,1879UlmMahatmaGandhi10/2,1869PorbandarPersonBirthDateBirthPlace...PersonScientificResultMaxPlanckQuantumTheoryPersonCollaboratorMaxPlanckAlbertEinsteinMaxPlanckNielsBohrPlanck‘sconstant6.2261023JsConstantValueDimensioncombineNLP,patternmatching,lexicons,statisticallearningextractedfactsoftenhaveconfidence<1DBwithuncertainty(probabilisticDB)expensiveanderror-proneFormalizingthescraperapproach:GRDDLGRDDLformalizesthescraperapproach.Forexample:<htmlxmlns=""><headprofile=""><title>SomeDocument</title><linkrel="transformation"href="http:…/dc-extract.xsl"/><metaname="DC.Subject"content="Somesubject"/>...</head>...<spanclass="date">2006-01-02</span>...</html>yields,throughdc-extract.xsl:<>dc:subject"Somesubject";dc:date"2006-01-02".GRDDLThetransformationitselfhastobeprovidedforeachsetofconventionsAmoregeneralsyntaxisdefinedforXMLformatsingeneral(e.g.,viathenamespacedocument)amethodtogetdatainotherformatstoRDF(e.g.,XBRL)Examplefor“structure”:microformatsNotaSemanticWebspecification,originallythereisaseparatemicroformatcommunityApproach:re-use(X)HTMLattributesandelementstoadd“meta”informationtypically@abbr,@class,@title,…differentcommunityagreementsfordifferentapplicationsRDFaRDFaextends(X)HTMLabitby:defininggeneralattributestoaddmetadatatoanyelementsprovidesanalmostcomplete“serialization”ofRDFinXHTMLRDFaexampleForexample:<divabout=""><spanproperty="dc:date">March23,2004</span><spanproperty="dc:title">Rollershitcasinofor£1.3m</span>By<spanproperty="dc:creator">SteveBird</span>.See<ahref=""rel="dcmtype:MovingImage">alsovideofootage</a>…</div>yields,throughanRDFaprocessor:<>dc:date"March23,2004";dc:title"Rollershitcasinofor£1.3m;dc:creator"SteveBird";dcmtype:MovingImage<>.Example:Yahoo’sSearchMonkeySearchbasedresultsmaybecustomizedviasmallapplicationsMetadatainpages(inRDFa,microformatsetc)arereusedCourtesyofPeterMika,Yahoo!Research,(SWEOCaseStudy)Example:Google’srichsnipletEmbeddedmetadata(inmicroformatorRDFa)isusedtoimprovesearchresultpageatthemomentonlyafewvocabulariesarerecognized,butthatwillevolveovertheyearsExample:RDFadatabythe
LondonGazetteExample:RDFadatabythe
LondonGazetteBridgetorelationaldatabasesDataontheWebaremostlystoredindatabases“Bridges”arebeingdefined:alayerbetweenRDFandtherelationaldataRDBtablesare“mapped”toRDFgraphs,possiblyontheflydifferentmappingapproachesarebeingusedanumberRDBsystemsofferthisfacilityalready(eg,Oracle,OpenLink,…)AsurveyonmappingtechniqueshasbeenpublishedatW3CAcharterisunderreviewforaW3Cgroup,tostartinSeptemberLinkingDataLinkingOpenDataProjectGoal:“expose”opendatasetsinRDFSetRDFlinksamongthedataitemsfromdifferentdatasetsSetupqueryendpointsAltogetherbillionsoftriples,millionsoflinks…Exampledatasource:DBpediaDBpediaisacommunityefforttoextractstructured(“infobox”)informationfromWikipediaprovideaqueryendpointtothedatasetinterlinktheDBpediadatasetwithotherdatasetsontheWebExtractingWikipediastructureddata@prefixdbpedia<>.@prefixdbterm<>.dbpedia:Amsterdam
dbterm:officialName“Amsterdam”;
dbterm:longd“4”;dbterm:longm“53”;dbterm:longs“32”;...
dbterm:leaderTitle“Mayor”;
dbterm:leaderNamedbpedia:Job_Cohen;...dbterm:areaTotalKm“219”;...dbpedia:ABN_AMROdbterm:locationdbpedia:Amsterdam;...Automaticlinksamongopendatasets<Amsterdam>
owl:sameAs<...>;owl:sameAs<>;...<>owl:sameAs<Amsterdam>wgs84_pos:lat“52.3666667”;wgs84_pos:long“4.8833333”;geo:inCountry<>;...Processorscanswitchautomaticallyfromonetotheother…TheLOD“cloud”,March2008TheLOD“cloud”,September2008TheLOD“cloud”,July2009TheLOD“cloud”,Sep.2011
31billionRDFtriplesUsingtheLODtobuildWebsite:BBCUsingtheLODtobuildWebsite:BBCUsingtheLODtobuildWebsite:BBCQueryRDFData
(SPARQL)RDFdataaccessHowdoIquerytheRDFdata?e.g.,howdoIgettotheDBpediadata?QueryingRDFgraphsRemembertheJenaidiom:StmtIteratoriter=model.listStatements(subject,null,null);while(iter.hasNext()){st=iter.next();p=st.getProperty();o=st.getObject();do_something(p,o);Inpractice,morecomplexqueriesintotheRDFdataarenecessarysomethinglike:“givemethe(a,b)pairofresources,forwhichthereisanxsuchthat(xparenta)and(bbrotherx)holds”(ie,returntheuncles)theserulesmaybecomequitecomplexThegoalofSPARQL(QueryLanguageforRDF)AnalysetheJenaexampleStmtIteratoriter=model.listStatements(subject,null,null);while(iter.hasNext()){st=iter.next();p=st.getProperty();o=st.getObject();do_something(p,o);The(subject,?p,?o)isapatternforwhatwearelookingfor(with?pand?oas“unknowns”)General:graphpatternsThefundamentalidea:usegraphpatternsthepatterncontainsunboundsymbolsbybindingthesymbols,subgraphsoftheRDFgraphareselectedifthereissuchaselection,thequeryreturnsboundresourcesOurJenaexampleinSPARQLSELECT?p?oWHERE{subject?p?o}ThetriplesinWHEREdefinethegraphpattern,with?pand?o“unbound”symbolsThequeryreturnsallp,opairsSimpleSPARQLexampleSELECT?isbn?price?currency#note:not?x!WHERE{?isbna:price?x.?xrdf:value?price.?xp:currency?currency.}SimpleSPARQLexampleReturns:
[[<..49X>,33,£],[<..49X>,50,€],[<..6682>,60,€],[<..6682>,78,$]]SELECT?isbn?price?currency#note:not?x!WHERE{?isbna:price?x.?xrdf:value?price.?xp:currency?currency.}PatternconstraintsSELECT?isbn?price?currency#note:not?x!WHERE{?isbna:price?x.?xrdf:value?price.?xp:currency?currency.FILTER(?currency==€}Returns:[[<..409X>,50,€],[<..6682>,60,€]]RDFDataModel151URIURILiteralsRDFGraph152EntityVertexLiteralVertexSPARQLQueries153SPARQLQuery:Select?nameWhere{?m<hasName>?name.?m<BornOnDate>“1809-02-12”.?m<DiedOnDate>“1865-04-15”.}QueryGraphSubgraphMatchvs.SPARQLQueries154OtherSPARQLfeaturesLimitthenumberofreturnedresults;removeduplicates,sortthem,…OptionalbranchesinthequerySpecifyseveraldatasources(viaURI-s)withinthequery(essentially,amerge!)ConstructagraphcombiningaseparatepatternandthequeryresultsUsedatatypesand/orlanguagetagswhenmatchingapatternSPARQLusageinpracticeSPARQLisusuallyusedoverthenetworkseparatedocumentsdefinetheprotocolandtheresultformatSPARQLProtocolforRDFwithHTTPandSOAPbindingsSPARQLresultsinXMLorJSONformatsBigdatasetsusuallyoffer“SP
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 河北軟件職業(yè)技術(shù)學(xué)院《建筑數(shù)字技術(shù)》2023-2024學(xué)年第二學(xué)期期末試卷
- 2025年陜西省建筑安全員考試題庫及答案
- 山東城市建設(shè)職業(yè)學(xué)院《建筑工程概預(yù)算實驗》2023-2024學(xué)年第二學(xué)期期末試卷
- 四川工商學(xué)院《生態(tài)環(huán)境學(xué)》2023-2024學(xué)年第二學(xué)期期末試卷
- 南京工業(yè)大學(xué)浦江學(xué)院《用戶研究與設(shè)計定義》2023-2024學(xué)年第二學(xué)期期末試卷
- 陽江職業(yè)技術(shù)學(xué)院《材料形變加工新技術(shù)》2023-2024學(xué)年第二學(xué)期期末試卷
- 青島濱海學(xué)院《設(shè)備安裝》2023-2024學(xué)年第二學(xué)期期末試卷
- 新鄉(xiāng)學(xué)院《建筑設(shè)備》2023-2024學(xué)年第二學(xué)期期末試卷
- 新疆職業(yè)大學(xué)《有機化學(xué)理論教學(xué)》2023-2024學(xué)年第二學(xué)期期末試卷
- 徐州醫(yī)科大學(xué)《數(shù)字化版面設(shè)計ndesgn》2023-2024學(xué)年第二學(xué)期期末試卷
- 2025年官方領(lǐng)養(yǎng)兒童策劃協(xié)議書
- 2025年官方策劃完整個人離婚協(xié)議書模板
- 2025年度跨境電商平臺股權(quán)合同轉(zhuǎn)讓協(xié)議
- 2025年益陽醫(yī)學(xué)高等??茖W(xué)校高職單招數(shù)學(xué)歷年(2016-2024)頻考點試題含答案解析
- 餐飲業(yè)的供應(yīng)鏈管理與優(yōu)化
- 2025年紹興市上虞大眾勞動事務(wù)代理(所)有限公司招聘筆試參考題庫附帶答案詳解
- 心律失常介入并發(fā)癥及預(yù)防
- 《分娩機轉(zhuǎn)》課件
- 口腔醫(yī)院市場營銷新入職員工培訓(xùn)
- 軍隊文職備考(面試)近年考試真題(參考300題)
- 金融業(yè)稅收優(yōu)惠政策指引
評論
0/150
提交評論