1. Biotea + Reactome + COLIL

2. Biotea + Uniprot

3. Annotations coming from GO or CHEBI in articles with snomed:Renal cell carcinoma

4. Common SNOMED CT tags between two articles (pmc:3875424 and pmc:3933681)

5. Get all the annotations for one article (pmc:3865095)

6. Biotea + Uniprot + DBPedia

7. Biotea + Open Citations

1. Biotea + Reactome + COLIL

Retrieve all the pathways referencing “insulin” from Reactome and also search for the literature annotated with GO terms like “chemical homeostasis” or any of its subclasses, e.g. “lipid homeostasis” and “triglyceride catabolic process”, the NCIt “insulin” and “insulin signaling pathway” as well as the SNOMED term “homeostasis” -all of these are GO annotations in the resulting pathways from Reactome along with the citations contexts of the papers coming from COLIL.

Execute it in the endpoint

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX oa:<http://www.w3.org/ns/oa#>
PREFIX biotea:<https://biotea.github.io/biotea-ontololgy#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX bibo: <http://purl.org/ontology/bibo/>
PREFIX colil: <http://purl.jp/bio/10/colil/ontology/201303#>
PREFIX doco: <http://purl.org/spar/doco/>
PREFIX togows: <http://togows.dbcls.jp/ontology/ncbi-pubmed#>
PREFIX biopax3: <http://www.biopax.org/release/biopax-level3.owl#>

SELECT DISTINCT ?articleTitle ?pmid (GROUP_CONCAT(DISTINCT(?context);separator="|") as ?contexts) (GROUP_CONCAT(DISTINCT(?pathwayname);separator="|") as ?pathwaynames)
WHERE {

	?annotInsulin a oa:Annotation ;
		  oa:hasTarget ?paragraphInsulin ;
		  oa:hasBody <http://purl.bioontology.org/ontology/SNOMEDCT/21979002>.
	?paragraphInsulin oa:hasSource ?article .
	?article dcterms:title ?articleTitle .
        ?article bibo:pmid ?pmid .
    {
	SERVICE <http://sparql.bioontology.org/ontologies/sparql/?apikey=INSERT-YOUR-API-KEY-HERE> {
		?child rdfs:subClassOf <http://purl.obolibrary.org/obo/GO_0048878> .
	}
        ?paragraph oa:hasSource ?article .
        ?annot a oa:Annotation ;
		  oa:hasTarget ?paragraph ;
		  oa:hasBody ?annotationBody.
       FILTER(?annotationBody IN (?child, <http://purl.obolibrary.org/obo/GO_0048878>, <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C2271>))
    }
    SERVICE <http://colil.dbcls.jp/sparql> {
		?citationPaper bibo:cites ?referencePaper .
		?citationPaper doco:contains [
		  doco:contains [
		    rdf:value ?context ;
		    colil:mentions ?referencePaper
		  ]
		] .
		?referencePaper rdfs:seeAlso [
		  rdf:type colil:PubMed ;
		  togows:pmid ?pmid
		] .
	}
	SERVICE <https://www.ebi.ac.uk/rdf/services/reactome/sparql> {
		?pathway rdf:type biopax3:Pathway .
		?pathway biopax3:displayName ?pathwayname .
		?pathway biopax3:pathwayComponent ?reaction . 
		?reaction rdf:type biopax3:BiochemicalReaction . 
		{
			{?reaction ?rel ?protein .}   
	   		UNION 
	   		{
	   			?reaction  ?rel  ?complex . 
				?complex rdf:type biopax3:Complex .  
				?complex ?comp ?protein . 
			}
		} 
		?protein rdf:type biopax3:Protein . 
		?protein biopax3:entityReference <http://purl.uniprot.org/uniprot/P01308> 
	} 
} GROUP BY ?articleTitle ?pmid

2. Biotea + Uniprot

Retrieve all the articles containing ncit:Placebo Control, ncit:Crossover Study, snomed:Glucose tolerance test, go:insulin secretion, go:glucose metabolic process and the entries from Uniprot related with go:glucose metabolic process, go:response to insulin and uniprot:Diabetes mellitus, non-insulin-dependent (NIDDM).

Execute it in the endpoint

PREFIX uniprotkb:<http://purl.uniprot.org/core/> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX oa:<http://www.w3.org/ns/oa#>
PREFIX biotea:<https://biotea.github.io/biotea-ontololgy#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX bibo: <http://purl.org/ontology/bibo/>

select distinct ?articleTitle ?pmid (GROUP_CONCAT(?uniprotEntry;separator="|") as ?uniprotEntries) where {

		?placeboAnnot a oa:Annotation ;
		  oa:hasTarget ?placeboParagraph ;
		  oa:hasBody <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C49648> .
		?placeboParagraph oa:hasSource ?article .

		?crossoverAnnot a oa:Annotation ;
		  oa:hasTarget ?crossoverParagraph ;
		  oa:hasBody <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C82637> .
		?crossoverParagraph oa:hasSource ?article .

		?glucoseAnnot a oa:Annotation ;
		  oa:hasTarget ?glucoseParagraph ;
		  oa:hasBody <http://purl.bioontology.org/ontology/SNOMEDCT/113076002> .
		?glucoseParagraph oa:hasSource ?article .

		?insulinAnnot a oa:Annotation ;
		  oa:hasTarget ?insulinParagraph ;
		  oa:hasBody <http://purl.obolibrary.org/obo/GO_0030073> .
		?insulinParagraph oa:hasSource ?article .

		?metabolicAnnot a oa:Annotation ;
		  oa:hasTarget ?metabolicParagraph ;
		  oa:hasBody <http://purl.obolibrary.org/obo/GO_0006006> .
		?metabolicParagraph oa:hasSource ?article .

		?article dcterms:title ?articleTitle .
        ?article bibo:pmid ?pmid .

	SERVICE <http://sparql.uniprot.org/sparql> {
		 ?uniprotEntry uniprotkb:classifiedWith <http://purl.obolibrary.org/obo/GO_0006006> .
		 ?uniprotEntry uniprotkb:classifiedWith <http://purl.obolibrary.org/obo/GO_0032868> .
		 ?unitprotEntry uniprotkb:annotation ?uniprotEntryAnnotation .
		 ?uniprotEntryAnnotation uniprotkb:disease <http://purl.uniprot.org/diseases/2060> .
		}
} GROUP BY ?articleTitle ?pmid

3. Annotations coming from GO or CHEBI in articles with snomed:Renal cell carcinoma

Execute it in the endpoint

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX oa:<http://www.w3.org/ns/oa#>
PREFIX biotea:<https://biotea.github.io/biotea-ontololgy#>

SELECT DISTINCT ?article ?annot STR(?strText) AS ?text xsd:integer(?tf) AS ?frequency ?ontoBody 
WHERE {
  SELECT DISTINCT ?article ?annot ?strText ?tf ?ontoBody 
  WHERE {
    ?annot a oa:Annotation ;
      oa:hasTarget ?paragraph ;
      oa:hasBody ?ontoBody ;
      oa:hasBody ?textualBody ;
      biotea:tf ?tf .
    ?paragraph oa:hasSource ?article .
    ?textualBody a oa:TextualBody ;
      rdf:value ?strText .
    FILTER (STRSTARTS(STR(?ontoBody), "http://purl.obolibrary.org/obo/GO_") || STRSTARTS(STR(?ontoBody), "http://purl.obolibrary.org/obo/CHEBI_"))
    {
      SELECT DISTINCT ?article
      WHERE {
        ?annot a oa:Annotation ;
          oa:hasTarget ?paragraph ;
          oa:hasBody <http://purl.bioontology.org/ontology/SNOMEDCT/41607009> .
        ?paragraph oa:hasSource ?article .
      }
    }
  } ORDER BY ?article ?annot ?ontoBody
}

4. Common SNOMED CT tags between two articles (pmc:3875424 and pmc:3933681)

Execute it in the endpoint

PREFIX oa: <http://www.w3.org/ns/oa#>
PREFIX biotea: <https://biotea.github.io/biotea-ontololgy#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?termUri ?termFrequency ?termFrequency1 ?label
{
    ?annotation a oa:Annotation .
    ?annotation oa:hasTarget ?paragraph .
    ?annotation oa:hasBody ?termUri .
    ?annotation oa:hasBody ?text .
    ?text rdf:value ?label .
    ?annotation biotea:tf ?termFrequency .
    ?paragraph oa:hasSource <http://linkingdata.io/pmcdoc/pmc/3875424> .
    
    ?annotation1 a oa:Annotation .
    ?annotation1 oa:hasTarget ?paragraph1 .
    ?annotation1 oa:hasBody ?termUri .
    ?annotation1 oa:hasBody ?text1 .
    ?text1 rdf:value ?label1 .
    ?annotation1 biotea:tf ?termFrequency1 .
    ?paragraph1 oa:hasSource <http://linkingdata.io/pmcdoc/pmc/3933681> .

    FILTER NOT EXISTS { ?termUri a oa:TextualBody }
    FILTER ( STRSTARTS(STR(?termUri), "http://purl.bioontology.org/ontology/SNOMEDCT") )
}

5. Get all the annotations for one article (pmc:3865095)

Execute it in the endpoint


PREFIX oa: <http://www.w3.org/ns/oa#>
PREFIX biotea: <https://biotea.github.io/biotea-ontololgy#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?termUri ?termFrequency ?label
{
    ?annotation a oa:Annotation .
    ?annotation oa:hasTarget ?paragraph .
    ?annotation oa:hasBody ?termUri .
    ?annotation oa:hasBody ?text .
    ?text rdf:value ?label .
    ?annotation biotea:tf ?termFrequency .
    ?paragraph oa:hasSource <http://linkingdata.io/pmcdoc/pmc/3865095> .
    FILTER NOT EXISTS { ?termUri a oa:TextualBody }
}

6. Biotea + Uniprot + DBPedia

Execute it in the endpoint

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX oa:<http://www.w3.org/ns/oa#>
PREFIX biotea:<https://biotea.github.io/biotea-ontololgy#>   
PREFIX uniprotkb:<http://purl.uniprot.org/core/>    
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbo: <http://dbpedia.org/ontology/>

SELECT DISTINCT ?articleTitle ?pmcLink ?dbpediaDesc (GROUP_CONCAT(?uniprotEntry;separator="|") as ?uniprotEntries)
      WHERE {
        ?annot a oa:Annotation ;
          oa:hasTarget ?paragraph ;
          oa:hasBody <http://purl.bioontology.org/ontology/SNOMEDCT/40095003> .
        ?paragraph oa:hasSource ?article .
        ?annot1 a oa:Annotation ;
          oa:hasTarget ?paragraph1 ;
          oa:hasBody <http://purl.bioontology.org/ontology/SNOMEDCT/63730009> .
        ?paragraph1 oa:hasSource ?article .
        ?article rdfs:seeAlso ?pmcLink .
        ?article dcterms:title ?articleTitle .
       FILTER(STRSTARTS(str(?pmcLink), "http://www.ncbi.nlm.nih.gov/pmc/"))
       
  SERVICE <https://dbpedia.org/sparql>
  {
    ?calcitonin rdfs:label ?label .
    ?calcitonin rdfs:comment ?dbpediaDesc .
    FILTER(lang(?dbpediaDesc) = 'en')
    FILTER(?label = "Calcitonin"@en)
  }

       SERVICE <http://sparql.uniprot.org/sparql> {
		 ?uniprotEntry <http://purl.uniprot.org/core/classifiedWith> <http://purl.obolibrary.org/obo/GO_0032841> .
       }

} GROUP BY ?articleTitle ?pmcLink ?dbpediaDesc

7. Biotea + Open Citations

Execute it in the endpoint

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX oa:<http://www.w3.org/ns/oa#>
PREFIX biotea:<https://biotea.github.io/biotea-ontololgy#>
PREFIX bibo: <http://purl.org/ontology/bibo/>
PREFIX cito: <http://purl.org/spar/cito/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX datacite: <http://purl.org/spar/datacite/>
PREFIX literal: <http://www.essepuntato.it/2010/06/literalreification/>
PREFIX biro: <http://purl.org/spar/biro/>
PREFIX frbr: <http://purl.org/vocab/frbr/core#>
PREFIX c4o: <http://purl.org/spar/c4o/>

SELECT DISTINCT ?title ?citedBy ?cited_ref
{
  ?annot a oa:Annotation ;
    oa:hasTarget ?paragraph ;
    oa:hasBody <http://purl.bioontology.org/ontology/SNOMEDCT/41607009> .
  ?paragraph oa:hasSource ?article .
  ?article bibo:pmid ?pmid .
  SERVICE <http://opencitations.net/sparql> {
    ?cited datacite:hasIdentifier [
        datacite:usesIdentifierScheme datacite:pmid ;
        literal:hasLiteralValue ?pmid 
      ] .
    ?citedBy cito:cites ?cited .
    OPTIONAL { 
      ?citedBy frbr:part ?ref .
      ?ref biro:references ?cited ;
        c4o:hasContent ?cited_ref
    }
	
    OPTIONAL { ?cited dcterms:title ?title }
  }
}