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

error querying for rdf:type with "larger" transaction #458

Open
jakep36 opened this issue Apr 26, 2023 · 3 comments
Open

error querying for rdf:type with "larger" transaction #458

jakep36 opened this issue Apr 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working as expected
Milestone

Comments

@jakep36
Copy link

jakep36 commented Apr 26, 2023

I've attached a Postman collection with this.

After creating the db, transacting the SHACL and transacting the smaller data transaction the query for rdf:type ex:Movie works as expected.

After creating the db, transacting the SHACL and transacting the larger data transaction the query for rdf:type ex:Movie does not work as expected.

It gives an error in the results of:

"data": {
            "status": 400,
            "error": "db/invalid-query"
        },
        "message": "Undefined RDF type specified: https://example.com/Movie",
        "suppressed": [],
        "localizedMessage": "Undefined RDF type specified: https://example.com/Movie"
    }

But you can query the data by something else like one of the predicate names and it does show results like the two query in the multi-query.

large transaction issue.postman_collection.json.zip

@jakep36 jakep36 added the bug Something isn't working as expected label Apr 26, 2023
@haliechm
Copy link

haliechm commented Apr 26, 2023

large_txn_issue.zip

Here is the same zip with a few modifications

The main change is that I initially supplied the incorrect SHACL rules above... this is the cause of the error posted ( "Undefined RDF type specified: https://example.com/Movie")

With the new SHACL rules supplied, no error is thrown when running the query on the large dataset. However, the query comes back with an empty list instead. Oddly enough, the data does seem to be in the ledger (ie there are instances of type "ex:Movie" that can be queried for)

@dpetran
Copy link
Contributor

dpetran commented Jun 9, 2023

I took a look at this yesterday, here's what I found:

  1. there wasn't a request for creating a second "large" ledger, so I just transacted everything into the "ledgerTestSmall" ledger
  2. the "transact large" request failed, for multiple reasons. The first was a bug concerning how we were validating "sh:class" constraints. The second was just a validation error - we were passing integers in where the shacl schema was expecting floats. Adding this @context to the request fixed it:
 "@context": {
            "https://example.com/population": {
                "@type": "xsd:float"
            },
            "https://example.com/area": {
                "@type": "xsd:float"
            },
            "https://example.com/runtime": {
                "@type": "xsd:float"
            },
            "https://example.com/budget": {
                "@type": "xsd:float"
            },
            "https://example.com/revenue": {
                "@type": "xsd:float"
            },
            "https://example.com/rating": {
                "@type": "xsd:float"
            }
        },
  1. The queries work fine now.

@dpetran
Copy link
Contributor

dpetran commented Jun 9, 2023

Fix for the bug in #501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

4 participants