Skip to content
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

Different results for same where-conditions in different order. #23

Open
ivan-klass opened this issue Jan 20, 2015 · 0 comments
Open

Different results for same where-conditions in different order. #23

ivan-klass opened this issue Jan 20, 2015 · 0 comments

Comments

@ivan-klass
Copy link

As declared in the beginning of tutorial, logical meaning of :where [ __a_clause__ ] [__b_clause__] is same as :where [ __b_clause__ ] [__a_clause__]. However, this rule doesn't work in following task:

http://www.learndatalogtoday.org/chapter/4

Task 2 : Find all available attributes, their type and their cardinality. ...

This is considered as correct query:

[:find ?attr ?type ?card
 :where
 [_ :db.install/attribute ?a]
 [?a :db/valueType ?t] 
 [?a :db/cardinality ?c]
 [?a :db/ident ?attr]
 [?t :db/ident ?type]
 [?c :db/ident ?card]]

But when simply changing the order of condition clauses - result changes and warning appears. Example:

[:find ?attr ?type ?card
 :where
 [?a :db/valueType ?t] 
 [?a :db/cardinality ?c]
 [?a :db/ident ?attr]
 [?t :db/ident ?type]
 [?c :db/ident ?card]
 [_ :db.install/attribute ?a]]

In my case it was very confusing - because I managed to compose the query like in last example, and finally had to "give up".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant