Successfully reported this slideshow.
Your SlideShare is downloading. ×

Expressive Query Answering For Semantic Wikis

Loading in …3

Check these out next

1 of 33 Ad

More Related Content

Slideshows for you (20)


Similar to Expressive Query Answering For Semantic Wikis (20)

More from Jie Bao (20)


Recently uploaded (20)

Expressive Query Answering For Semantic Wikis

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