SPARQL negation Rules of the Semantic Web Semantic MediaWiki NSWI Jan Dědek
PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX owl: PREFIX owl2xml: PREFIX stud: 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
Semantic Web Stack Latest “layercake” diagram
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)
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
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| [[Corresponds to::1 W]] [[Corresponds to::0.001 kW]] [[Corresponds to:: hp]]
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}}]]
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}}