- From: Doerthe Arndt <doerthe.arndt@tu-dresden.de>
- Date: Fri, 7 Jul 2023 14:09:20 +0000
- To: Ivan Herman <ivan@w3.org>
- CC: "semantic-web@w3.org" <semantic-web@w3.org>
- Message-ID: <4861074D-1F91-467B-82CB-E42297A32618@tu-dresden.de>
Dear Ivan, Just one quick answer: I am not even sure whether the built-ins are always required (most likely not), but they are in the files we shared to make the reasoning performant. An example for eq-diff3 without built-ins (apart from rdf:first and rdf:rest which you could understand as built in) is here: https://n3-editor.herokuapp.com/n3/editor/s/Fa712hqP But your point is interesting: the built-ins should relate to other standards. So far we are trying to find out which built-ins we need to fully implement SPARQL with all its filter functions, that goes into the same direction. We will certainly keep your comment in mind. Kind regards, Dörthe Am 07.07.2023 um 15:14 schrieb Ivan Herman <ivan@w3.org<mailto:ivan@w3.org>>: Doerthe, William, thank you both for the answers. If I understand the references right (I cannot get behind the paywall of Springer for the some of them) the implementation of features like property chain axioms rely on suitable built-ins; I expected that, although I was not sure (I do not have experience with n3 usage beyond the documentation). Which raises one more question to me, looking ahead to a possible full standardization path of n3 at W3C: if we ever get to that point, it may look much better if the final standard on built-ins included the definition of those that are necessary to implement OWL 2 RL (I do not know about OWL 2 EL). The relationship among the different technologies published by W3C is always a question, and this may come up during a formal review, for example. Just a thought… Thanks! Ivan On 7 Jul 2023, at 14:27, Doerthe Arndt <doerthe.arndt@tu-dresden.de<mailto:doerthe.arndt@tu-dresden.de>> wrote: Dear all, The OWL-RL rules are for example available for at the EYE repository (note that these rules are the rules from the OWL2 spec inheriting the problems these might have): https://eulersharp.sourceforge.net/2003/03swap/eye-owl2.html Some of the rules use built-in functions like for example eq-diff3 which Ivan mentioned below: https://eulersharp.sourceforge.net/2003/03swap/owl-distinctMembers.html In the past, I used some optimizations to make the reasoning faster (paper: https://link.springer.com/chapter/10.1007/978-3-319-33245-1_10), if you are interested, I can also provide the rules. I am sure that N3 can also cover OWL-EL (there is for example this nice tutorial where this has been implemented in existential rules https://iccl.inf.tu-dresden.de/web/Rules_ECAI_Tutorial_2020/en). N3 supports existential rules, so OWL-EL is possible, but we do not have not even the basic rules yet and no optimization of any kind. To also answer the questions: 1. SPARQL works over the output of both kinds of reasoning, all it needs is an RDF graph. However, in N3 (at least with EYE and Cwm, most likely also with jen3) you can also specify filter rules or queries. You basically mark certain rules as queries and the reasoning run will give you only the results of these particular rules as output. In EYE you can even produce csv with that. As N3 supports many built-ins, such rules might be an alternative for queries. We are also currently working on the translation from SRARQL to N3, but this is work in progress. 2. N3 follows the open world assumption, but it allows scoped negation as failure. More concretely that means that you can ask the reasoner whether something can be derived from the facts and rules you gave as input. One of the predicates using a scope is log:collectAlIn (see https://w3c.github.io/N3/reports/20230703/builtins.html#log:collectAllIn). If you’d like to use the predicate to express negation, use an empty list as argument (example: https://n3-editor.herokuapp.com/n3/editor/s/9J0rKNEm). Feel free to ask for further details if you are interested :) Kind regards, Dörthe Am 06.07.2023 um 18:19 schrieb Christopher Yocum <cyocum@gmail.com<mailto:cyocum@gmail.com>>: Dear Ivan and William, Thank you very much for your explanations. This was very helpful. I am intrigued by the differences. I tend to use OntoText GraphDB with OWL2 RL with my data as I have an ontology which works for my use case (Medieval Irish Genealogies). I assume that SPARQL will work over both? One thing about OWL2 that is sometimes difficult to grasp is the Open World Assumption. Does N3 use "Open World" or is it a "Closed World"? Thank you again for your time. All the best, Chris On Thu, Jul 6, 2023 at 4:23 PM Ivan Herman <ivan@w3.org<mailto:ivan@w3.org>> wrote: William, (and Christopher) just to add one thing to the comparison. Where N3 and OWL 2 "meet" in some ways is the RL profile of OWL 2[1]. This is a "subset" of OWL 2 that can be implemented using rules. Actually, the spec includes the list of rules[2] that can be implemented, e.g., by a forward chaining engine, to offer an OWL 2 reasoner. I think it would be worthwhile to add a comparison of N3 with OWL 2 RL in the document, b.t.w. Cheers Ivan (At a first glance, the translation most of the rules in [2] into N3 looks trivial, ie, it is possible to create an N3 "graph" that can be used as a set of OWL 2 RL axioms. There are some rules where, I must admit, I do not see at first glance how to make this translation in general, like eq-diff3, prp-spo2; these all are not "rules" in [2] but more a family or rules for lists.) [1] https://www.w3.org/TR/owl2-profiles/#OWL_2_RL [2] https://www.w3.org/TR/owl2-profiles/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules On 6 Jul 2023, at 16:11, William Van Woensel <william.vanwoensel@gmail.com<mailto:william.vanwoensel@gmail.com>> wrote: Thanks for your question. (The report does have a section on relations with other languages, but it does not include OWL2!) Both are declarative formalisms for describing your domain or problem - you can then let a reasoner fill in the blanks or try and solve the problem. But, they differ in the kind of logic and reasoning they apply. Their usefulness depends on your use case, and, to some extent, your personal preferences. TL;DR OWL2 is related to Description Logics - you define class expressions in terms of constraints on their individuals, and then use a reasoner (such as hermit, pellet,...) to find inconsistencies, classify individuals (put them under the right class), or determine subsumption (subclass relations). Notation3 (N3) is a rule language - you can define logical implications, basically if-then rules, which state what can be inferred from other triples. A reasoner (such as eye, cwm or jen3) can then generate all applicable inferences given a set of triples. In addition, N3 has builtins for math, string, time and other operations, as well as builtins for scoped negation as failure (to "close" the world to an extent). Longer answer: The question is complex and has multiple aspects. Since you asked from a developer point of view I try to emphasise that aspect. OWL2 DL is based on description logics, which is a decidable fragment of first order logic. Decidability is a big advantage, but it also comes with certain restrictions on the things you can and can’t express. Intuitively, you rather think about classes and subclasses in which you can or cannot put individuals. OWL2 allows disjunctions (“or”) which are only partly supported by rule-based reasoning. If you want to add rules to that “class world", you can use SWRL. N3 is a rule language for the Web. That means you can directly state which triples should be derived by which other triples. As N3 allows you to write rules introducing new blank nodes, we know that N3 - even without any built-ins or exotic patterns - is not decidable, because logically, we are dealing with existential rules. This, however, is in most practical cases a rather theoretical problem. That said, both OWL and N3 reasoners will sometimes need to capitulate and report a time-out for some corner cases. Hope that clarifies matters. William & Doerthe On Jul 5, 2023, at 3:00 PM, Christopher Yocum <cyocum@gmail.com<mailto:cyocum@gmail.com>> wrote: Hi, This seemed interesting so I went to have a look at it. After reading a good part of the primer, I am wondering what the difference between N3 and OWL2 are and why I would choose one over the other or if they are complementary, how they relate to each other? Is there a resource that covers this for the "middle of the road" developer? I did a quick Google but I am not coming up with anything that might help immediately. Thanks and all the best, Chris On Wed, Jul 5, 2023 at 6:12 AM Ivan Herman <ivan@w3.org<mailto:ivan@w3.org>> wrote: Putting my W3C staff member's hat on… As Doerthe says below, N3 is not just a minor extension to RDF 1.2, so adding it now to the RDF Star WG's work would go beyond the charter of that WG. I believe it would be more appropriate for the N3 Community Group to prepare itself to propose a bona fide Working Group charter that would be scheduled to kick in once RDF 1.2 is properly closed. It will then have to go through the usual hooplas at W3C to get the charter (hopefully) accepted by the W3C membership and do the rest of the work to turn it into a formal Recommendation. Hans, this is not a dumb suggestion at all. Cheers Ivan On 4 Jul 2023, at 14:04, Doerthe Arndt <doerthe.arndt@tu-dresden.de<mailto:doerthe.arndt@tu-dresden.de>> wrote: Dear Hans, It is a very good idea to combine efforts on N3 and RDF 1.2, but I am afraid that N3 is too complex to be added directly to RDF 1.2. More concrete: N3 allows the use of graphs as terms just like RDF-star supports triples as terms. The latter already causes a lot of discussions since different potential users (naturally) have different expectations. I guess a more complex construct of similar nature will even create more tension. Therefore, the N3 working group plans to wait for the outcome of RDF 1.2 to then incorporate the (possible) changes of RDF to N3. Note that some reasoners like for example EYE (https://github.com/eyereasoner/eye) already support RDF-star. So far, I do not see major problems if we want to include RDF-star to N3 (of course that will also depend on the semantics chosen, EYE currently follows the community group report). Kind regards, Dörthe Am 04.07.2023 um 10:16 schrieb hans.teijgeler@quicknet.nl<mailto:hans.teijgeler@quicknet.nl>: Is it a dumb suggestion to combine this N3 effort with the earlier reported RDF 1.2 one, in order to avoid divergence? -----Original Message----- From: David Booth <david@dbooth.org<mailto:david@dbooth.org>> Sent: Monday, 3 July 2023 21:11 To: semantic-web@w3.org<mailto:semantic-web@w3.org> Subject: Re: Notation3 Community Group Report Release On 7/3/23 13:29, William Van Woensel wrote: We are happy to inform you that the first Notation3 Community Group Report has been released: https://w3c.github.io/N3/spec/ <https://w3c.github.io/N3/spec/> Awesome! Great work! Thanks, David Booth Notation3 (also known as N3) is an assertion and logic language that is a superset of Turtle, featuring logical implications (rules), graph terms, and builtins ranging from datatype operations to accessing online knowledge and performing scoped negation as failure. We also created an educational resource as a lightweight introduction to Notation3 (which also lists currently available resources): https://notation3.org/ <https://notation3.org/> We invite you to submit any feedback or issues to our GitHub page: https://github.com/w3c/N3 <https://github.com/w3c/N3> Kind regards, W3C N3 CG Group ---- Ivan Herman, W3C Home: http://www.w3.org/People/Ivan/ mobile: +33 6 52 46 00 43 ---- Ivan Herman, W3C Home: http://www.w3.org/People/Ivan/ mobile: +33 6 52 46 00 43 ---- Ivan Herman, W3C Home: http://www.w3.org/People/Ivan/ mobile: +33 6 52 46 00 43
Received on Friday, 7 July 2023 14:09:42 UTC