Presentation is loading. Please wait.

Presentation is loading. Please wait.

SPARQL negation Rules of the Semantic Web Semantic MediaWiki NSWI140 24.11.2010 Jan Dědek.

Similar presentations


Presentation on theme: "SPARQL negation Rules of the Semantic Web Semantic MediaWiki NSWI140 24.11.2010 Jan Dědek."— Presentation transcript:

1 SPARQL negation Rules of the Semantic Web Semantic MediaWiki NSWI140 24.11.2010 Jan Dědek

2 PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#http://www.w3.org/1999/02/22-rdf-syntax-ns# PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#http://www.w3.org/2000/01/rdf-schema# PREFIX xsd: http://www.w3.org/2001/XMLSchema#http://www.w3.org/2001/XMLSchema# PREFIX owl: http://www.w3.org/2002/07/owl#http://www.w3.org/2002/07/owl# PREFIX owl2xml: http://www.w3.org/2006/12/owl2-xml#http://www.w3.org/2006/12/owl2-xml# PREFIX stud: http://www.semanticweb.org/ontologies/NSWI140/Study.owl#http://www.semanticweb.org/ontologies/NSWI140/Study.owl# SELECT ?name ?student ?year ?subject WHERE { ?studentastud:Student; stud:hasName?name; stud:hasStudyYear?year. OPTIONAL { ?student stud:hasSubject?subject. ?subject astud:DatabseSubject. } FILTER ( ?year > 1 ) FILTER ( ! bound(?subject) ) } ORDER BY ?name SPARQL negation - ! bound predicate

3 Semantic Web Stack Latest “layercake” diagram http://www.w3.org/2001/sw/layerCake.png

4 Protege Rules Examples Student(?s), hasStudyYear(?s, ?y), greaterThan(?y, "2"^^integer) -> Senior(?s) Room(?r), hasName(?r, ?n), startsWith(?n, "S") -> RoomMalaStrana(?r) Person(?p), hasSalaryInCZK(?p, ?czk), multiply(?eur, 24.7, ?czk) -> hasSalaryInEUR(?p, ?eur) SWRL - Semantic Web Rule Language Rules saved as part of ontology Increasing tool support: Bossam, R2ML, Hoolet, Pellet, KAON2, RacerPro SWRLTab - Protégé 3, RulesView - Protégé 4 (Ontology views) http://protege.stanford.edu/conference/2009/slides/SWRL2009ProtegeConference.pdf

5 Semantic MediaWiki (SMW) Editing –Categories (MW) –Properties (named links & values) –Data types Custom units –Semantic templates (MW -> SMW) –Service links (links to online services: e.g. maps) Semantic Web –RDF export –Reusing vocabulary from external ontologies –Importing ontologies –SPARQL query service Search –Selecting pages Categories and property values –wildcards and comparators, not equal, like (regexp) Distance queries Unions Subqueries and property chains Templates and variables –Sorting results –Displaying information Special:Ask, inline queries Printing: property values, categories Display format: Plain, types –Concepts (stored queries) –Inline queries: #ask, #show, Exporting query results: RSS, etc. –Query settings (strict comparators) Inferencing: –Subcategories (MW), Subproperties, Equality of pages: (MW) redirects Not supported: Transitivity, Inverse properties, Domain and range restrictions, Number restrictions and functional properties

6 SMW Editing Categories Properties Data types –Custom units Semantic templates (MW -> SMW) Service links (links to online services: e.g. maps) [[Category:Example category]] [[property name::value]] [[Is capital of::Germany]] [[population::3,396,990]] [[Has type::number]] Type:Temperature [[provides service::online maps]] MediaWiki:Smw service online maps IMDb|http://www.imdb.com/title/tt$1/ [[Corresponds to::1 W]] [[Corresponds to::0.001 kW]] [[Corresponds to::0.0013410220 hp]]

7 SMW Search Selecting pages Categories and property values –wildcards and comparators, not equal, like (regexp) Distance queries Unions disjunctions in values Subqueries and property chains Templates and variables [[Category:Actor]] [[born in::Boston]] [[height::180cm]] [[Category:Actor]] [[height::>1.89m]] [[height::!1.89m]] [[Address::~*Park Place*]] [[born in::Boston]] OR [[born in::New York]] [[Category:Musical actor||Theatre actor]] [[Category:Actor]] [[born in:: [[Category:City]] [[located in::Italy]] ]] [[Category:Event]] [[end date::>{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY}}]]

8 SMW Search Sorting results Displaying information –Special:Ask, inline queries –Printing: property values, categories –Display format: Plain, types Concepts (stored queries) Inline queries: #ask, #show, Exporting query results: RSS, etc. Query settings (strict comparators) {{#ask: [[Category:City]] |?Average rainy days |?Located in=Country |sort=Located in,Average rainy days |order=ASC,DESC }} [[Category:City]] [[has location country.population::+]] ?Population ?height#cm {{#ask: [[Category:City]] [[located in::Germany]] | ?population | ?area#km² = Size in km² }} {{#show: Berlin | ?population}}


Download ppt "SPARQL negation Rules of the Semantic Web Semantic MediaWiki NSWI140 24.11.2010 Jan Dědek."

Similar presentations


Ads by Google