query-31771c4a98ddfc9f6df43a9dcdfd523b

rq turtle/ttl

Request all operons and their genes for Listeria monocytogenes EGD-e SELECT ?operon ?operonLabel (if(?label = "Forward Strand"@en, '+', '-') as ?strand) (group_concat(distinct ?locustag; separator=" ") as ?locustagG) WHERE { ?strain wdt:P685 "169963". # NCBI Taxonomy ID for Listeria monocytogenes EGD-e ?operon wdt:P703 ?strain; # get operon that is found in that genome wdt:P2548 ?strand; # get strand orientation wdt:P31 wd:Q139677; #instance of operon wdt:P527 ?gene. # has part gene (gets all genes in operon) ?gene wdt:P2393 ?locustag; # get ncbi locus tag for genes in operon wdt:P351 ?entrez. # get ncbi entrez id for genes in operon SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } ?strand rdfs:label ?label . filter(lang(?label) = 'en') } GROUP BY ?operonLabel ?strandLabel ?label ?operon ORDER BY ?operonLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Request all operons and their genes for Listeria monocytogenes EGD-e
SELECT ?operon ?operonLabel (if(?label = "Forward Strand"@en, '+', '-') as ?strand)
 (group_concat(distinct ?locustag; separator=" ") as ?locustagG) WHERE {
  ?strain wdt:P685 "169963". # NCBI Taxonomy ID for Listeria monocytogenes EGD-e
  ?operon wdt:P703 ?strain; # get operon that is found in that genome
          wdt:P2548 ?strand; # get strand orientation
          wdt:P31 wd:Q139677; #instance of operon
          wdt:P527 ?gene. # has part gene (gets all genes in operon)
  ?gene wdt:P2393 ?locustag; # get ncbi locus tag for genes in operon
        wdt:P351 ?entrez.  # get ncbi entrez id for genes in operon
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
   ?strand rdfs:label ?label . filter(lang(?label) = 'en')
} GROUP BY ?operonLabel ?strandLabel ?label ?operon
ORDER BY ?operonLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?entrez") v6("?gene") v2("?label"):::projected v7("?locustag"):::projected v9("?locustagG") v4("?operon"):::projected v1("?operonLabel"):::projected v3("?strain") v9("?strand") c1(["en"]):::literal c3(["169963"]):::literal c7(["wd:Q139677"]):::iri c12(["bd:serviceParam"]):::iri f0[["?label = 'en'"]] f0 --> v2 v3 --"wdt:P685"--> c3 v4 --"wdt:P703"--> v3 v4 --"wdt:P2548"--> v9 v4 --"wdt:P31"--> c7 v4 --"wdt:P527"--> v6 v6 --"wdt:P2393"--> v7 v6 --"wdt:P351"--> v8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c1 end v9 --"rdfs:label"--> v2 bind2[/"if(?label = sForward Strand^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>','+','-')"/] v2 --o bind2 bind2 --as--o v9 bind3[/"?locustag"/] v7 --o bind3 bind3 --as--o v9