Open adeslatt opened 4 days ago
Hi @adeslatt , sorry I am not sure I understood your issue :)
Are you trying to run this as a SPARQL query?
up:Disease_Annotation {
a [ up:Disease_Annotation ] ;
up:sequence [ up:Chain_Annotation up:Modified_Sequence ] ;
rdfs:comment xsd:string ;
up:disease IRI
}
If yes, then it is normal it is not working as is, because it is not a SPARQL query, this is a ShEx "Shape Expression", basically a schema for RDF data, see here for more details: https://shex.io
We are using it to pass the endpoint schema to the LLM
Hi @vemonet , Thank you so much! Yes I thought it was a SPARQL query -- I was not familiar with Shape Expression thank you for the reference -- can this work on the RDF as a file itself? I just exported from a database and made turtle files -- we are working with a non-SPARQL graph database (it is a ArangoDB instance).
ShEx expression are usually used to describe the schema of the RDF data, and perform validation of RDF data (here we just use it to communicate the schema of the different classes in our knowledge graph to the LLM, so it knows which predicates can be used with the different classes). In my opinion ShEx is a bit harder to use than SPARQL (because the libraries are less mature), so I would just load the RDF you have in a store and run SPARQL queries
If you just want to run queries on RDF data you could load it with RDFLib then run queries: https://rdflib.readthedocs.io/en/stable/
Hello -- just learning and may not know sytack -- but the example
Results in a malformed query when. you try it on the sparql endpoint for unitprot.
I set up a jupyter lab notebook - and this worked very nicely
Returns this (organized with pandas)
I modified the query a bit more using regular expression package (re) and used this: