Expressive Query Answering For Semantic Wikis

2,776 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,776
On SlideShare
0
From Embeds
0
Number of Embeds
66
Actions
Shares
0
Downloads
22
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Expressive Query Answering For Semantic Wikis

  1. 1. Expressive Query Answering For Semantic Wikis Jie Bao, Rensselaer Polytechnic Institute baojie@cs.rpi.edu, http://www.cs.rpi.edu/~baojie
  2. 2. Outline Background: Semantic MediaWiki General Design Issues: Semantics and Expressivity Formalizing SMW with Datalog Extending SMW Modeling and Query Languages Implementations and Experimental Results Jan 18, 2011 2
  3. 3. Semantic Wiki as a Data Store Jan 18, 2011 3
  4. 4. Semantic MediaWiki (SMW) 4 It is the most popular semantic wiki system extending MediaWiki Mediawiki: What you edit what you see Jan 18, 2011
  5. 5. Semantic MediaWiki 5 To author knowledge typed link (property) SMW: What you edit (Modeling Language) what you see Jan 18, 2011
  6. 6. Semantic MediaWiki 6 To retrieve knowledge SMW: What you edit (Querying Language) what you see Jan 18, 2011
  7. 7. Why SMW? Low-cost solution for light-weight semantic applications Integrated environment for modeling and querying Simple to setup, easy to use Can work with hundreds of other MW/SMW extensions Templating, Visualization, Editing, I/O, Workflow… Access Control, Forms, Maps, SPARQL… Jan 18, 2011 7
  8. 8. Expressivity (SMW 1.5.4) SMW-ML (Modeling Language) category instantiation e.g., [[Category:C]] property instantiation e.g., [[P::v]] subclass, e.g., [[Category:C]] (on a category page) subproperty, e.g., [[Subpropetyof:Property:P]] (on a property page) SMW-QL (Query Language) conjunction: e.g., [[Category:C]][[P::v]] disjunction: e.g., [[Category:C]] or [[P::v]], [[A||B]] or [[P::v||w]] property chain: e.g., [[P.Q::v]] property wildcat: e.g., [[P::+]] subquery: e.g., [[P::<q>[[Category:C]]</q>]] inverse property e.g., [[-P::v]] value comparison, e.g. [[P::>3]][[P::<7]][[P::!5]] Jan 18, 2011 8
  9. 9. However, we often need more expressivity Modeling Domain and Range: “has author” is from “person” to “document” Inverse property: “has author” <-> “author of” Transitive property: “part of” … Query Negation: find cities that are not capitals Counting: find professors who advise more than 5 students Jan 18, 2011 9
  10. 10. Extending SMW Goal: offer additional expressivity without losing “wikiness” (i.e., collaborative, simple, easy to learn, informality-tolerate, and evolving-capable ) Jan 18, 2011 10
  11. 11. Design Issues: Semantics and Expressivity Jan 18, 2011 11
  12. 12. Design Issue 1: Open or Close world? OWL/DL -Like DB/Rule-Like Jan 18, 2011 12 or
  13. 13. Design Issue 2: Expressivity Supported A subset of OWL that Can be implemented using rules Is syntactically simple for common wiki users Why not full OWL 2 RL or OWL 2 QL? Too complicated for most wiki users Jan 18, 2011 13
  14. 14. Design Issue 3: Implementation Reuse existing tools if we can Low learning curve: hide details from users; incremental changes from SMW Portability: allow users to choose different backend stores (MySQL, SQL Server, etc.) Fast enough for a typical semantic wiki (has < O(104) pages [1]) Jan 18, 2011 14 [1] http://semantic-mediawiki.org/wiki/Sites_using_Semantic_MediaWiki
  15. 15. Solution Formalizing SMW modeling and query languages using datalog Descriptive, closed-world semantics Well-understood complexity and many known optimizations Implementation: leverage highly-optimized LP solvers for reasoning, e.g., DLV, Clasp, and Smodels Reuse SMW UI for rendering query results Jan 18, 2011 15
  16. 16. Expressivity Modeling Language: a subset of OWL Prime (or RDFS++ named by others) rdfs:subClassOf, subPropertyOf, domain, range owl:TransitiveProperty, SymmetricProperty, FunctionalProperty, InverseFunctionalProperty, inverseOf owl:sameAs, equivalentClass, equivalentProperty Query Language: SMW-QL, plus Negation as failure Cardinality Jan 18, 2011 16
  17. 17. Modeling SMW with datalog Jan 18, 2011 17
  18. 18. Translation Rules for SMW-ML Subproperty Subclass Class instance Property instance Redirection P(x,y) :- Q(x,y) . C(x) :- D(x) . C(a) . P(a,b) . a=b. Jan 18, 2011 18
  19. 19. Translation Rules for SMW-QL {{#ask: [[Category:City]] [[capital of::+]] }} result(x) :- City(x), capital_of(x, y) . Jan 18, 2011 19
  20. 20. Translation Rules for SMW-QL result(x) :- _tmp0(x). _tmp0(x) :- A(x), p3(x,x0), x0=category:B. _tmp0(x) :- p(x,x2), p1(x2,x3), p2(x3,x1), _tmp9(x1). _tmp9(x1) :- _tmp12(x1). _tmp12(x1) :- D(x1). _tmp12(x1) :- p1(x1,x4), x4=SomePage. _tmp9(x1) :- thing(x), x !=v. _tmp9(x1) :- E(x1). {{#ask: [[Category:A]][[p3::category:B]] or [[p.p1.p2:: <q> [[Category:D]] or [[p1::<q>[[SomePage]]</q>]] </q> ||!v ||<q>[[Category:E]]</q> ]] }} Conjunction Property chain Disjunction Inequality Subquery Jan 18, 2011 20
  21. 21. Extending SMW-ML and SMW-QL Jan 18, 2011 21
  22. 22. SMW-ML+ [[Domain::C]] [[Range::C]] [[Type::Transitive]] [[Type::Symmetric]] [[Type::Functional]] [[Type::InverseFunctional]] [[Inverse of::Q]] C(x) :- P(x,y) C(y) :- P(x,y) P(x,y) :- P(x,z), P(z,y) P(x,y) :- P(y,x) SameAs(x,y) :- P(z,x),P(z,y) SameAs(x,y) :- P(x,z),P(y,z) Q(x,y) :- P(y,x) Jan 18, 2011 22 On page “Property:P”
  23. 23. SMW-QL+ : Negations {{#askplus: [[<>Category:C]] [[Category:D]] }} {{#askplus: [[Category:C]] [[<>P::+]] }} result(x) :- D(x), not C(x) . result(x) :- C(x), #count{x: P(x,y)}<=0 . Jan 18, 2011 23
  24. 24. SMW-QL+: (Non)qualified Cardinality {{#askplus: [[>=3#P::+]] }} {{#askplus: [[>=3#P:: <q>[[Category:D]]</q>]] }} result(x) :- thing(x), #count{x: P(x,y)}>=3 . result(x) :- thing(x), #count{x: P(x,y),D(y)}>=3 . Jan 18, 2011 24 For safeness
  25. 25. Theoretical Complexity Jan 18, 2011 25 Recall that L  NL  P  NP
  26. 26. Implementation and Experimental Results Jan 18, 2011 26
  27. 27. Implementation Using DLV as the reasoner Other LP solvers may be used as well Two work modes File-based: reasoning based on a static dump (snapshot) of wiki semantic data. Database-based:  reasoning based on a shadow database via ODBC; Real-time changes of instance data will be updated. Optimization Caching Jan 18, 2011 27
  28. 28. Example: Jan 18, 2011 28 Inverse property Caching Transitive property
  29. 29. Scalability: Data Complexity Test machine: 2 * Xeon 5365 Quad 3.0GHz 1333MHz /16G / 2 * 1TB Dataset: part of DBLP, 10,396 pages, 100,736 triples Jan 18, 2011 29 {{#askplus: [[Category:Person]] }} Near linear
  30. 30. Scalability: Query Complexity Jan 18, 2011 30 {{#askplus: [[Knows::<q>[[Knows::<q>[[Knows::<q>…</q>]]</q>]]</q>]] }} Near constant Dataset: DBLP 100k triples
  31. 31. Scalability: Query Complexity Jan 18, 2011 31 {{#askplus: [[Knows::+]] or [[Knows::+]] or [[Knows::+]] …}} Near constant Dataset: DBLP 100k triples
  32. 32. The SemanticQueryRDFS++ extension Jan 18, 2011 32 http://www.mediawiki.org/wiki/Extension:SemanticQueryRDFS++
  33. 33. Conclusions and Future Work Formalizing SMW using datalog allows us to analyze the reasoning complexity of SMW extend SMW modeling and query languages for an expressive subset of OWL implement a SMW query engine based on DLV that is scalable for typical uses. Future Work Incremental reasoning Customized reasoning rules SPARQL <-> SMW-QL+ translations Jan 18, 2011 33

×