Closed aaj3f closed 9 months ago
I'm not getting the error you're getting here, but maybe some owl:equivalentProperty
problems?
(let [conn @(fluree/connect {:method :memory})
ledger @(fluree/create conn "bug/property-iri"
{:defaultContext [test-utils/default-str-context
{"ex" "http://example.com/"
"owl" "http://www.w3.org/202/07/owl#"}]})
db0 (fluree/db ledger)
db1 @(fluree/stage db0 [{"@id" "bug/property-iri"
"@graph" [{"@id" "ex:givenName"
"@type" "rdf:Property"
"owl:equivalentProperty" {"@id" "ex:firstName"
"@type" "rdf:Property"}}]}])
db2 @(fluree/stage db1 [{"@id" "ex:andrew"
"ex:firstName" "Andrew"
"ex:age" 35}
{"@id" "ex:dan"
"ex:givenName" "Dan"}])]
;; this returns what we expect
(is (= [{"id" "ex:andrew", "ex:firstName" "Andrew", "ex:age" 35}]
@(fluree/query db2 {"select" {"?s" ["*"]}
"where" [["?s" "@id" "ex:andrew"]]})))
;; this doesn't return `ex:andrew`, even though `ex:givenName` and `ex:firstName`
;; are owl:equivalentProperties
(is (= [{"id" "ex:dan", "ex:givenName" "Dan"}]
@(fluree/query db2 {"select" {"?s" ["*"]}
"where" [["?s" "ex:givenName" "?o"]]})))
;; vice versa shows the same owl:equivalentProperties problem
(is (= [{"id" "ex:andrew", "ex:firstName" "Andrew", "ex:age" 35}]
@(fluree/query db2 {"select" {"?s" ["*"]}
"where" [["?s" "ex:firstName" "?o"]]}))))
Oh, wait, I see - we don't yet support from
in queries, that's the source of the invalid-query error.
Disregard - I was able to reproduce the issue in gateway.
Oh, wait, I see - we don't yet support
from
in queries, that's the source of the invalid-query error.
We do now, FYI: https://github.com/fluree/db/blob/7834d151a750f7d148f36ce50739448ba11933d0/src/fluree/db/json_ld/api.cljc#L317-L323
Description
If you introduce a property as a nested object / referent of another node, then that property can't be used in queries without throwing a
db/invalid-query: Invalid Predicate
errorSteps to reproduce:
(1) Create ledger
(2) Add vocab data
(3) Add entity data
(4) This query works fine
(5) This query throws the unexpected error