Closed manabuishii closed 2 years ago
I'll check it out, the to_sparql feature is pretty experimental, and there are a number of failure modes. I should be able to sort this out and get a fix on the develop branch shortly, however.
Thanks for your patience.
It's getting swallowed by the implicit JOIN, and some refactoring is required. Your query is parsed as follows:
(prefix ((obo: <http://purl.obolibrary.org/obo/>)
(taxon: <http://identifiers.org/taxonomy/>)
(rdfs: <http://www.w3.org/2000/01/rdf-schema#>)
(faldo: <http://biohackathon.org/resource/faldo#>)
(dc: <http://purl.org/dc/elements/1.1/>))
(dataset (<http://rdf.integbio.jp/dataset/togosite/ensembl>)
(distinct
(project (?parent ?child ?child_label)
(filter (contains (str ?parent) "terms/ensembl/")
(join
(extend
((?chromosome (strbefore (strafter (str ?ensg_location) "GRCh38/") ":")))
(bgp
(triple ?enst obo:SO_transcribed_from ?ensg)
(triple ?ensg a ?parent)
(triple ?ensg obo:RO_0002162 taxon:9606)
(triple ?ensg faldo:location ?ensg_location)
(triple ?ensg dc:identifier ?child)
(triple ?ensg rdfs:label ?child_label)) )
(table
(vars ?chromosome)
(row (?chromosome "1"))
(row (?chromosome "2"))
(row (?chromosome "3"))
(row (?chromosome "4"))
(row (?chromosome "5"))
(row (?chromosome "6"))
(row (?chromosome "7"))
(row (?chromosome "8"))
(row (?chromosome "9"))
(row (?chromosome "10"))
(row (?chromosome "11"))
(row (?chromosome "12"))
(row (?chromosome "13"))
(row (?chromosome "14"))
(row (?chromosome "15"))
(row (?chromosome "16"))
(row (?chromosome "17"))
(row (?chromosome "18"))
(row (?chromosome "19"))
(row (?chromosome "20"))
(row (?chromosome "21"))
(row (?chromosome "22"))
(row (?chromosome "X"))
(row (?chromosome "Y"))
(row (?chromosome "MT")))))))))
The existing code to output the BIND statements happens when the SELECT/WHERE is emitted, and it needs to move to the end of there internal JOIN clause.
@manabuishii This case should work now, and many other have been fixed. At this point, all of the SPARQL 1.0 functionality should work properly. There remain issues with GROUP/HAVING, Property Paths and many other 1.1 expressions, but it's coming along.
@gkellogg Thanks ‼️ I test and works fine.
I'm looking forward to it.
Great, I'm finishing up some corner-cases, and will push a release fairly soon; in the mean time, it's available from the develop branch.
Hello
I use rdf/sparql 3.2.0
I want to use
to_sparql
.The problem is when I use
to_sparql
, BIND is diappeared, when it is used with VALUES.When I test some code in sparql source code document. BIND works fine .
For example this query
https://togodx.integbio.jp/sparqlist/gene_biotype_ensembl
I just parsed above SPARQL and use
to_sparql
The result is here BIND is disappear.I tested original query without
VALUES
SPARQL query is following.And parsed result is here. BIND is not disappear.
BIND disappear Source Code is here
Remove VALUES, BIND is not disappear source code is