-
Notifications
You must be signed in to change notification settings - Fork 9
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
Incorrect behavior on string literals from csv-import #73
Comments
Hi,
How do you conclude from this that this is a VLog bug?
… On 26 Jun 2021, at 12:40, andreschamschurko ***@***.***> wrote:
Considering the following containments.csv:
"""chili sauce""","""chili pepper"""
"""beer""","""alcohol"""
juice,water
The input KB in Rulewerk syntax is:
@source contains[2]: load-csv("/home/.../containments.csv") .
The reasoning with the rulewerk client version 0.8.0 produces the following trace:
rulewerk> @query contains(?X, ?Y) .
?X -> "chili sauce", ?Y -> "chili pepper"
?X -> "beer", ?Y -> "alcohol"
?X -> juice, ?Y -> water
3 result(s) in 9ms. Results are sound and complete.
rulewerk> @query contains(?X, "chili pepper") .
0 result(s) in 0ms. Results are sound and complete.
rulewerk> @query contains(?X, "alcohol") .
0 result(s) in 0ms. Results are sound and complete.
rulewerk> @query contains(?X, water) .
?X -> juice
1 result(s) in 0ms. Results are sound and complete.
The expected behavior can be verified with the previous version 0.7.0:
rulewerk> @query contains(?X, ?Y) .
?X -> "chili sauce", ?Y -> "chili pepper"
?X -> "beer", ?Y -> "alcohol"
?X -> juice, ?Y -> water
3 result(s) in 1ms. Results are sound and complete.
rulewerk> @query contains(?X, "chili pepper") .
?X -> "chili sauce"
1 result(s) in 0ms. Results are sound and complete.
rulewerk> @query contains(?X, "alcohol") .
?X -> "beer"
1 result(s) in 0ms. Results are sound and complete.
rulewerk> @query contains(?X, water) .
?X -> juice
1 result(s) in 0ms. Results are sound and complete.
It seems that the facts containing string literals are not processed correctly.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Can you please try:
rulewerk> @query contains(?X, “chili pepper"^^<http://www.w3.org/2001/XMLSchema#string>)
… On 28 Jun 2021, at 09:05, Jacobs, C.J.H. ***@***.***> wrote:
Hi,
How do you conclude from this that this is a VLog bug?
> On 26 Jun 2021, at 12:40, andreschamschurko ***@***.***> wrote:
>
>
> Considering the following containments.csv:
>
> """chili sauce""","""chili pepper"""
> """beer""","""alcohol"""
> juice,water
>
> The input KB in Rulewerk syntax is:
>
> @source contains[2]: load-csv("/home/.../containments.csv") .
>
> The reasoning with the rulewerk client version 0.8.0 produces the following trace:
>
> rulewerk> @query contains(?X, ?Y) .
> ?X -> "chili sauce", ?Y -> "chili pepper"
> ?X -> "beer", ?Y -> "alcohol"
> ?X -> juice, ?Y -> water
> 3 result(s) in 9ms. Results are sound and complete.
> rulewerk> @query contains(?X, "chili pepper") .
> 0 result(s) in 0ms. Results are sound and complete.
> rulewerk> @query contains(?X, "alcohol") .
> 0 result(s) in 0ms. Results are sound and complete.
> rulewerk> @query contains(?X, water) .
> ?X -> juice
> 1 result(s) in 0ms. Results are sound and complete.
>
>
> The expected behavior can be verified with the previous version 0.7.0:
>
> rulewerk> @query contains(?X, ?Y) .
> ?X -> "chili sauce", ?Y -> "chili pepper"
> ?X -> "beer", ?Y -> "alcohol"
> ?X -> juice, ?Y -> water
> 3 result(s) in 1ms. Results are sound and complete.
> rulewerk> @query contains(?X, "chili pepper") .
> ?X -> "chili sauce"
> 1 result(s) in 0ms. Results are sound and complete.
> rulewerk> @query contains(?X, "alcohol") .
> ?X -> "beer"
> 1 result(s) in 0ms. Results are sound and complete.
> rulewerk> @query contains(?X, water) .
> ?X -> juice
> 1 result(s) in 0ms. Results are sound and complete.
>
> It seems that the facts containing string literals are not processed correctly.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or unsubscribe.
>
|
I get 0 results:
Another thing i tried, was adding all facts imported from the csv and got this:
|
Thank you. I suggest you report this issue in rulewerk. Since you use rulewerk, not vlog directly, and your example does not involve any reasoning, I’m not at all convinced that this is a vlog issue.
… On 29 Jun 2021, at 14:21, andreschamschurko ***@***.***> wrote:
I get 0 results:
rulewerk> @query contains(?X, "chili pepper"^^<http://www.w3.org/2001/XMLSchema#string>)
0 result(s) in 2ms. Results are sound and complete.
Another thing i tried, was adding all facts imported from the csv and got this:
rulewerk> @query contains(?X,?Y).
?X -> "chili sauce", ?Y -> "chili pepper"
?X -> "beer", ?Y -> "alcohol"
?X -> juice, ?Y -> water
3 result(s) in 0ms. Results are sound and complete.
rulewerk> @Assert contains("chili sauce", "chili pepper") .
Asserted 1 fact(s) and 0 rule(s).
rulewerk> @Assert contains("beer", "alcohol") .
Asserted 1 fact(s) and 0 rule(s).
rulewerk> @Assert contains(juice, water) .
Asserted 1 fact(s) and 0 rule(s).
rulewerk> @Reason .
Loading and materializing inferences ...
... finished in 0ms (0ms CPU time).
rulewerk> @query contains(?X,?Y).
?X -> juice, ?Y -> water
?X -> "chili sauce", ?Y -> "chili pepper"
?X -> "beer", ?Y -> "alcohol"
?X -> "chili sauce", ?Y -> "chili pepper"
?X -> "beer", ?Y -> "alcohol"
5 result(s) in 0ms. Results are sound and complete.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I think this is not a reasoning issue but something related to the API. From what I know, Rulewerk did not change any code related to how strings are represented, but updating the VLog version leads to different behaviour (this needs to be verified; I understand that the problem so far was seen by using different versions of Rulewerk and VLog, so it is not obvious what causes the problem). But we can investigate if there might have been any change in how data was passed from Rulewerk to VLog. If we are passing the same data but get different results, then it can still be that the new behaviour is "correct" and Rulewerk was written for the old "incorrect" behaviour, of course. Let's see what we can find out ... |
@mkroetzsch Could this issue be related to issue #55? |
When reading strings from a .csv file, vlog does not convert them to "..."^^http://www.w3.org/2001/XMLSchema#string. |
@andreschamschurko Could you please try changing the .csv file such that all strings have ^^http://www.w3.org/2001/XMLSchema#string appended and then see what happens? |
With the following csv:
I get:
|
I think it works with the following containments.csv: """chili sauce""^^http://www.w3.org/2001/XMLSchema#string","""chili pepper""^^http://www.w3.org/2001/XMLSchema#string" Note that http://www.w3.org/2001/XMLSchema#string should have < and > delimiters. |
I still get the error:
|
I think the < > delimiters are missing in your .csv file. I don't know how to disable markdown in these comments, so you don't see them, but they are there in what I wrote. I'll try again:
|
You are right I misunderstood the sentence with the delimiters.
|
So, I'm pretty sure that the difference between Rulewerk 0.7.0 and 0.8.0 comes from Rulewerk's changed handling of strings, see the discussion in issue #55. I'm closing this issue. |
There is still a problem there. RDF, OWL, and Rulewerk do not distinguish |
A yes, re-opening. |
It's mainly a design decision, whether VLog wants to use the RDF model for data values or something more general with literals that are not native to RDF. In the latter case, Rulewerk would need to find a clean way to represent any additional kinds of values in its RDF-based type system. This can be done, but I am not sure if it is convenient. RDF itself used to distinguish |
Maybe we should add an RDF mode to Vlog, so that, when running in that mode, |
This could be a way, but I wonder if there are any cases where the non-RDF mode would be of interest. The two distinct forms of strings only can play a role if one also uses data of the form Conversely, even in RDF-mode, it would be ok for users if their |
That sounds like a plan. I'm not working today, though, so this will have to wait until next week. |
And this would also solve issue #55. |
So, when this issue will be solved, when loading an RDF file containing constants |
Fixed, SPARQL results remain to be tested in open issue knowsys/rulewerk#223. |
Considering the following
containments.csv
:The input KB in Rulewerk syntax is:
The reasoning with the rulewerk client version 0.8.0 produces the following trace:
The expected behavior can be verified with the previous version 0.7.0:
It seems that the facts containing string literals are not processed correctly.
The text was updated successfully, but these errors were encountered: