Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Expressive Query Answering For Semantic Wikis (20min)

A 20 minutes version of the talk

  • Als Erste(r) kommentieren

Expressive Query Answering For Semantic Wikis (20min)

  1. 1. Expressive Query Answering For Semantic Wikis<br />Jie Bao, Rensselaer Polytechnic Institute<br />baojie@cs.rpi.edu, http://www.cs.rpi.edu/~baojie<br />
  2. 2. Semantic Wiki as a Data Store<br />May 10, 2011<br />2<br />
  3. 3. Semantic Media Wiki (SMW)<br />Low-cost solution for light-weight semantic applications<br />Dozens of extensions to build apps.<br />Integrated environment for modeling and querying<br />SMW-ML (Modeling language): subclass/subproperty<br />SMW-QL (Query language): disjunctive query with subquery<br />(detailed SMW expressivity in the backup slides)<br />May 10, 2011<br />3<br />
  4. 4. However, we often need more expressivity<br />Modeling<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 />May 10, 2011<br />4<br />
  5. 5. Desired Expressivity <br />Balance between expressiveness and simplicity<br />Modeling Language: OWL Prime [1]<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 (aggregation)<br />May 10, 2011<br />5<br />[1] http://www.w3.org/2007/OWL/wiki/OwlPrime<br />
  6. 6. Formalization<br />Note: Semantic Wiki is NOT an open world (as oppose to OWL)<br />Formalizing OWL Prime with CWA using datalog<br />Descriptive, closed-world semantics<br />Well-understood complexity and mature tool support<br />May 10, 2011<br />6<br />
  7. 7. 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 />May 10, 2011<br />7<br />On page “Property:P”<br />Not owl:sameAs!<br />
  8. 8. Translation Rules for SMW-QL<br />{{#ask:<br /> [[Category:City]]<br /> [[capital of::+]] <br />}}<br />result(x) :- City(x), capital_of(x, y) .<br />May 10, 2011<br />8<br />Other constructs: for conjunction, disjunction, subquery, property chain etc, see backup slides<br />
  9. 9. 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 />Why not “C(x), not P(x,y)” ?<br />May 10, 2011<br />9<br />
  10. 10. 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(x)}>=3 .<br />May 10, 2011<br />10<br />For safeness<br />
  11. 11. 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 />May 10, 2011<br />11<br />Download: http://www.mediawiki.org/wiki/Extension:SemanticQueryPlus<br />
  12. 12. Example:<br />May 10, 2011<br />12<br />Inverse property<br />Caching<br />Transitive property<br />
  13. 13. 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 />May 10, 2011<br />13<br />{{#askplus: [[Category:Person]] }}<br />Almost linear <br />
  14. 14. Scalability: Query Complexity<br />May 10, 2011<br />14<br />{{#askplus: [[Knows::<q>[[Knows::<q>[[Knows::<q>…</q>]]</q>]]</q>]] }}<br />Almost constant<br /><ul><li>Dataset: DBLP 100k triples</li></li></ul><li>The SemanticQueryRDFS++ extension<br />May 10, 2011<br />15<br />http://www.mediawiki.org/wiki/Extension:SemanticQueryRDFS++<br />
  15. 15. Some other work on SMW by us<br />Semantic History – tracking provenance of semantics http://www.mediawiki.org/wiki/Extension:SemanticHistory <br />Tetherless Map – query-based map generation http://www.mediawiki.org/wiki/Extension:Tetherless_Map <br />DBLP Import – bibtex to semantic wikihttp://www.mediawiki.org/wiki/Extension:DBLP_Import <br />Array Extension – operate on arrayshttp://www.mediawiki.org/wiki/Extension:ArrayExtension <br />RDFa Extension – RDFa <-> Wikihttp://www.mediawiki.org/wiki/Extension:ArrayExtension<br />Joint work with Li Ding, Jin Zheng, Rui Huang<br />May 10, 2011<br />16<br />
  16. 16. Summary<br />Formalizing SMW using datalog allows us to<br />extend SMW for an expressive subset of OWL.<br />implement a SMW query engine that is scalable good for typical uses.<br />analyze the reasoning complexity of SMW (not mentioned in the talk)<br />Future Work<br />Incremental reasoning<br />Customized reasoning rules<br />SPARQL <-> SMW-QL+ translations<br />May 10, 2011<br />17<br />
  17. 17. Backup<br />May 10, 2011<br />18<br />
  18. 18. 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 />May 10, 2011<br />19<br />
  19. 19. 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 />May 10, 2011<br />20<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 />May 10, 2011<br />21<br />
  21. 21. Theoretical Complexity<br />May 10, 2011<br />22<br />Recall that L  NL  P  NP<br />

×