p2m2 / discovery

Discovery provides a powerful toolset for developers who are looking to build UIs using RDF data in an a robust software development process
https://p2m2.github.io/discovery/
MIT License
0 stars 1 forks source link

Wrong Sparql generation from simle query #197

Open ofilangi opened 2 years ago

ofilangi commented 2 years ago
SWDiscovery(config)
       .something("uri")
       .set(URI(uri))
       .isSubjectOf(QueryVariable("relation"),"datatype")
       .console()
       .select("relation","datatype")
       .commit().raw()
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?uri ?relation ?datatype

WHERE {
    VALUES ?uri { <http://rdf.ncbi.nlm.nih.gov/pubchem/reference/PMID34198149> } .
    ?uri ?relation ?datatype .
{ { ?relation ?property_relation ?object_relation } UNION { [] ?relation [] } UNION {  ?subject_relation ?property_relation ?relation } }
}