query-fa9af1e7b73ec70b29c02438770823e2

rq turtle/ttl

Synia: compound

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX target: <http://www.wikidata.org/entity/Q306135>

SELECT DISTINCT ?description ?value ?valueUrl
WHERE {
  {
    BIND(1 AS ?order)
    BIND("Compound" AS ?description)
    BIND(target: AS ?iri)
    BIND(SUBSTR(STR(?iri), 32) AS ?q) 
    ?iri rdfs:label ?value_string . 
    FILTER (LANG(?value_string) = 'en')
    BIND(COALESCE(?value_string, ?q) AS ?value)
  }
  UNION
  {
    BIND(100 AS ?order)
    BIND("" AS ?description)
    BIND(SUBSTR(STR(target:), 32) AS ?q) 
    BIND("Scholia ↗" AS ?value)
    BIND(CONCAT("https://scholia.toolforge.org/chemical/", ?q) AS ?valueUrl)
  }
} 
ORDER BY ?order

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?description"):::projected v4("?iri") v7("?order") v7("?q") v7("?value"):::projected v7("?valueUrl"):::projected v2("?value_string") subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; bind0[/"'100^^xsd:integer'"/] bind0 --as--o v7 bind1[/"''"/] bind1 --as--o v7 bind2[/"substring(str(http://www.wikidata.org/entity/Q306135),'32^^xsd:integer')"/] bind2 --as--o v7 bind3[/"'Scholia ↗'"/] bind3 --as--o v7 bind4[/"concat('https://scholia.toolforge.org/chemical/',?q)"/] v7 --o bind4 bind4 --as--o v7 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; f5[["?value_string = 'en'"]] f5 --> v2 bind6[/"'1^^xsd:integer'"/] bind6 --as--o v7 bind7[/"'Compound'"/] bind7 --as--o v7 bind8[/"http://www.wikidata.org/entity/Q306135"/] bind8 --as--o v4 bind9[/"substring(str(?iri),'32^^xsd:integer')"/] v4 --o bind9 bind9 --as--o v7 v4 --"rdfs:label"--> v2 bind10[/"?value_string?q"/] v2 --o bind10 v7 --o bind10 bind10 --as--o v7 end union0r <== or ==> union0l end