sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

20_search_chemical_names_in_japanese

Search for Chemical names starting in Japanese, translated to english using allie

Use at

PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT
*
WHERE {
SERVICE <https://data.allie.dbcls.jp/sparql>{
        ?x rdfs:label "1,2,4-トリクロロベンゼン"@ja ;
            rdfs:label ?englishLabel .
        FILTER(lang(?englishLabel) = "en")
    }
  BIND(STR(?englishLabel) AS ?englishLabelStr)
  ?chebi rdfs:label|oboInOwl:hasSynonym ?englishLabelStr .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?chebi"):::projected 
  v1("?englishLabel"):::projected 
  v3("?englishLabelStr"):::projected 
  v2("?x"):::projected 
  c4([s1,2,4-トリクロロベンゼン^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]):::literal 
  subgraph s1["https://data.allie.dbcls.jp/sparql"]
    style s1 stroke-width:4px;
    f0[["?englishLabel = 'en'"]]
    f0 --> v1
    v2 --"rdfs:label"-->  c4
    v2 --"rdfs:label"-->  v1
  end
  bind1[/"str(?englishLabel)"/]
  v1 --o bind1
  bind1 --as--o v3
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    v4 --"oboInOwl:hasSynonym"-->  v3
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    v4 --"rdfs:label"-->  v3
  end
  union0r <== or ==> union0l
  end