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

return @type instead of rdf:type #553

Merged
merged 5 commits into from
Aug 3, 2023
Merged

return @type instead of rdf:type #553

merged 5 commits into from
Aug 3, 2023

Conversation

dpetran
Copy link
Contributor

@dpetran dpetran commented Aug 2, 2023

Fixes #551

Uses the json-ld @type keyword instead of the rdf http://www.w3.org/1999/02/22-rdf-syntax-ns#type IRI.

Also fixes #537 by throwing an error during insert if it comes across the rdf:type IRI.

@@ -68,7 +68,7 @@

@(fluree/query (fluree/db ledger)
{:select {'?s [:* {:schema/isBasedOn [:*]}]}
:where [['?s :rdf/type :schema/Movie]]})
:where [['?s :type :schema/Movie]]})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rdf:type or @type should work the same for a query - so these shouldn't need changing, but it shouldn't hurt to to change them either.

It is in the responses, when doing a graph crawl specifically, that we should default to returning @type instead of defaulting to rdf:type.

SPARQL will parse near directly into FlureeQL, and @type doesn't exist in SPARQL... so we don't want to loose rdf:type. SPARQL does not support a graph crawl response, which is where we are in unique Fluree land... and that is why it makes sense to change the default behavior there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've added an explicit test that shows the following:

  1. you cannot transact with an rdf:type predicate
  2. you can query with an rdf:type predicate and it behaves the same as using @type

fixes #537

rdf:type is the RDF equivalent of the JSON-LD keyword @type

We don't support data coming in with rdf:type, though we do support querying with it, as
it is equivalent to @type.
@dpetran dpetran requested a review from a team August 3, 2023 15:55
Copy link
Contributor

@mpoffald mpoffald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍍

@dpetran dpetran merged commit ff04df6 into main Aug 3, 2023
5 checks passed
@dpetran dpetran deleted the task/return-type branch August 3, 2023 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants