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

Complete (datatype) implementation #713

Open
aaj3f opened this issue Jan 12, 2024 · 0 comments
Open

Complete (datatype) implementation #713

aaj3f opened this issue Jan 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@aaj3f
Copy link
Contributor

aaj3f commented Jan 12, 2024

Description

We have pending tests for use of datatype in queries, but it appears implementation of this syntax isn't complete (it may require whitelisting the fn for use in bind and/or filter etc)

(deftest ^:integration ^:pending datatype-test
(let [conn (test-utils/create-conn)
ledger @(fluree/create conn "people")
db @(fluree/stage
(fluree/db ledger)
{"@context" ["https://ns.flur.ee"
test-utils/default-context
{:ex "http://example.org/ns/"}]
"insert"
[{:id :ex/homer
:ex/name "Homer"
:ex/age 36}
{:id :ex/bart
:ex/name "Bart"
:ex/age "forever 10"}]})]
(testing "including datatype in query results"
(let [query {:context [test-utils/default-context
{:ex "http://example.org/ns/"}]
:select '[?age ?dt]
:where '[{:ex/age ?age}
[:bind ?dt (datatype ?age)]]}
results @(fluree/query db query)]
(is (= [["forever 10" "xsd:string"] [36 "xsd:long"]]
results))))
(testing "filtering query results with datatype fn")
(testing "filtering query results with @type value map")))

The tests describe three scenarios:

  • "including datatype in query results" (via bind)
  • "filtering query results with datatype fn"
  • "filtering query results with @type value map"

We have a community-driven use case that requires this and so are prioritizing it

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

No branches or pull requests

1 participant