-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No distinction between variables and constants: #7
Comments
In my view, and the only sane way to process, IMO, is that scoping is also effectively lexical, with constants used before they are asserted in I think we should make this clear. |
If we keep the behaviour of quantifiers (ie If we want to make sure that the position of the quantifier doesn't matter we could alternatively reserve a name space for variables, In that case it would be clear that the :h is a variable and it would not matter where its quantifier is located. |
See my comment in #5 (comment). The ordering of triples shouldn't matter, but for example, if you had |
I agree with you and would follow your argumentation if we hadn't what I describe in #6. What is your opinion there? In my opinion quantifiers are somehow like prefix-declarations (and based on your examples I think you share that opinion?) and their order should matter, but then we have the W3C team submission which says that on the same formula the universal quantification always dominates the existential quantification. I think either the order of quantifiers in a file matters or it does not, this statement with universals and existentials seems to me like a weird exception. PS: I tested your prefix-example on EYE and Cwm and can report that EYE behaves the way you describe it while Cwm gives an error. |
I confess that I really don't understand the distinction described in #6. I agree that they are similar to prefix definitions, in as much as where the exist in the source matters for how they are interpreted. I think the issues come if the variables have the same names, but I treat them all as being separate variables in any case.
I don't really understand how this plays out in practice. I'd like to see an example to illustrate the difference in operation, which is independent of naming confusion. |
I hope that the discussion on the other issue already helped. I repeat it here to be in line with the issue, but if you want, I can also come up with another example. So, take the case of Raymond again, but assume that we do not know his name, we only know that there is a person that every other person loves. I would expect that you could express that as:
In practice, we could apply the rule to other triples and derive from:
That The interpretation of N3 as stated in the w3c team submission now translates the statement above to:
This means: "Everyone loves someone." In this interpretation the loved ones can be different. Applied on the triples above (Julies, Steve, Nancy) we would get the result:
Or, using blank node notation again: Note, that here we have different blank nodes as the existential quantifier was dependent of the universal. |
These examples raise the notion of binding of variables in the outer-most scope (default graph). My interpretation of I think that evaluating your intermediate solution would yield the following: @forSome :x.
:x a :Person.
:Julie a :Person; :loves :x .
:Steve a :Person; :loves :x.
:Nancy a :Person; :loves :x. However, this is not in the form of an implication, so doesn't actually add triples to the dataset, it simply creates more bindings. Because _:x a :Person; :loves _:x .
:Julie a :Person; :loves _:x .
:Steve a :Person; :loves _:x.
:Nancy a :Person; :loves _:x. It is the same as the previous, if you make the graph lean.
Yes, or "Everyone loves everyone" depending on if existential quantifiers can bind to more than one thing. Can existential quantifiers bind to more than one node? If there are no bindings, is it bound to a new blank node? |
Note, that there is a difference between
This is exactly the point, you do not know which one and you cannot simply bind your x to any possible person. Remember how I constructed the example, I was talking about Raymond and simply "forgot" his name, so I used the existential quantifier. How can you assume that the person whose name I forgot here was Your example is a little bit like when I say: "There exists a person who speaks Chinese." and you make from it: "Ah, I know William and he is a person, so he must speak Chinese." This is not a valid conclusion. You just know that someone exists. That is all. Not more, but also not less.
This whole reasoning would be true if you had either the formula:
or
In both cases the rule means that all persons love each other as you state above. But in the example I gave, the position of the
Please note that according to the w3c team submission, the two formulas
and
Have the same meaning. So yes, the below is another way to express the above.
It cannot have both meanings at the same time, it is either the first or the second. |
As discussed in the N3-dev meeting today, it is proposed to use Well-Known IRIs for the names of variables. This is similar to what RDF 1.1 is doing in https://www.w3.org/TR/rdf11-concepts/#section-skolemization but the proposal here is to register (for instance) the name "genid-n3" according to http://www.rfc-editor.org/rfc/rfc5785.html#section-5.1 Here is a concrete example:
When the variable name is not declared via #eye --no-qvars --nope --n3 http://josd.github.io/eye/reasoning/iq/iq.n3 --pass-all PREFIX var: http://josd.github.io/.well-known/genid-n3/pCGZpyvjRMMypZsUVMeJGBW46yM# var:e_x_1 :says {var:e_x_2 :knows :Albert}. |
Sorry if this is a silly remark - but I assume that it is the intention that the N3 system would automatically generate the unique variable namespace for each document (e.g., based on the document hash)? If so, would the developer then only use the "var" prefix and let the N3 system fill in the actual namespace (?) |
When writing n3 files manually as a developer you have the responsibility to mint your own free variable namespace prefix. Reasoners can also generate quantified/free variables e.g. each reasoning run is minting a unique var: namespace prefix. |
I'm unsure where we've landed on this issue - I think it was tabled at the time and we did not revisit it. Currently the Jena+N3 system treats variables as originally in N3, I think - i.e., as IRIs that have a prior quantification, and without a separate var namespace. Whenever there is a potential conflict is found (e.g., using an IRI
Can easily be printed as
Asking developers to use a separate "var" prefix for variables side-steps this issue, but I really dislike having to coin a unique namespace for each N3 graph (and I don't think it's realistic to ask it of developers when manually authoring N3). |
In our last meeting, it was proposed to solve the above issue by using the SPARQL $-notation for variables together with quantifiers. Instead of an IRI such as:
We would say
In general, we could use the $-notation for free variables. Typically, we would expect these variables to be bound by a quantifier. The use of IRIs for these cases would be deprecated. Before we further discuss (and agree) on the way we handle quantifiers (issue #6 ), I would like to reach consensus for this decision, so could everyone please vote below (+1 or thumbs-up if you agree, 0 if neutral (no idea which emoji to use here, sorry) , -1 or thumbs-down if you disagree, for the latter please also state your arguments). |
This works fine now in EYE but would be in conflict when |
I believe this has become a moot point, since the current N3 spec would not support explicit quantification :-) |
Related to #6 , it can be a problem that variables and constants are not clearly distinguished. Look for example at the first occurence of :h in this formula:
Given the reversal of quantifiers when interpreting it (∀h: ∃g: ...) it is not clear to me whether this :h is a universally quantified variable or a constant.
The text was updated successfully, but these errors were encountered: