Skip to content

Commit

Permalink
move sparql queries in main resources directory
Browse files Browse the repository at this point in the history
  • Loading branch information
evaletolab committed May 26, 2014
1 parent 868507a commit ba206c6
Show file tree
Hide file tree
Showing 69 changed files with 250 additions and 347 deletions.
104 changes: 52 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This project also demonstrates how to use and configure a triplestore (open-virt
<!--
###RDFS and queries,
* [initial rdf schema](src/main/resources/owl)
* [view all sparql queries](src/test/resources/sparql)
* [view all sparql queries](src/main/resources/sparql)
-->

###Get your own triplestore instance
Expand All @@ -46,7 +46,7 @@ $mvn install:install-file -Dfile=virtjdbc4.jar -DgroupId=virtuoso.jdbc4 -Dartifa
$mvn -Dtest=Integrity test
```
###Run all rdf tests
* [view all sparql test](src/test/java/evaletolab/rdf)
* [view all sparql test](src/main/java/evaletolab/rdf)
```shell
$mvn -Dtest=evaletolab.rdf.* test
```
Expand All @@ -60,62 +60,62 @@ $ ff localhost:6969

![SNORQL](src/main/webapp/resources/img/snorql.png "snorql frontend")

###Use case for [evidences](src/test/java/evaletolab/rdf/Evidences.java)
* [Q53](src/test/resources/sparql/Q53-1-involvedInGO0007155_WithEvidence_NotIEA_And_NotISS.sparql) which are involved in cell adhesion according to GO with an evidence not IAE and not ISS
* [Q57](src/test/resources/sparql/Q57-locatedInMitochondrionWithEvidenceOtherThan_HPA_And_DKFZ_GFP.sparql) which are located in mitochondrion with an evidence other than HPA and DKFZ-GFP
* [Q63](src/test/resources/sparql/Q63-with1RRM_RNAbindingDomainWithEvidenceIEAorISS.sparql) which have >=1 RRM RNA-binding domain and either no GO "RNA binding" other a GO "RNA binding" with evidence IEA or ISS
###Use case for [evidences](src/main/java/evaletolab/rdf/Evidences.java)
* [Q53](src/main/resources/sparql/Q53-1-involvedInGO0007155_WithEvidence_NotIEA_And_NotISS.sparql) which are involved in cell adhesion according to GO with an evidence not IAE and not ISS
* [Q57](src/main/resources/sparql/Q57-locatedInMitochondrionWithEvidenceOtherThan_HPA_And_DKFZ_GFP.sparql) which are located in mitochondrion with an evidence other than HPA and DKFZ-GFP
* [Q63](src/main/resources/sparql/Q63-with1RRM_RNAbindingDomainWithEvidenceIEAorISS.sparql) which have >=1 RRM RNA-binding domain and either no GO "RNA binding" other a GO "RNA binding" with evidence IEA or ISS

###Use case for [expression](src/test/java/evaletolab/rdf/Expression.java)
###Use case for [expression](src/main/java/evaletolab/rdf/Expression.java)
* QX Proteins that are not highly expressed in liver at embrion stage
* [Q4](src/test/resources/sparql/Q4-highlyExpressedInBrainButNotInTestis.sparql) highly expressed in brain but not expressed in testis
* [Q11](src/test/resources/sparql/Q11-expressedInLiverAndInvolvedInTransport.sparql) that are expressed in liver and involved in transport
* Q[15](src/test/resources/sparql/Q15-PDZdomainthatInteractWithProteinExpresssedInBrain.sparql) with a PDZ domain that interact with at least 1 protein which is expressed in brain
* [Q17](src/test/resources/sparql/Q17-gt1000aaAndLocatedInNucleusAndExpressedInNervousSystem.sparql) >=1000 amino acids and located in nucleus and expression in nervous system
* [Q20](src/test/resources/sparql/Q20-HPAOnChromosome21highlyExpresssedInHeartAtIHCLevel.sparql) with >=2 HPA antibodies whose genes are located on chromosome 21 and that are highly expressed at IHC level in heart
* [Q50](src/test/resources/sparql/Q50-expressedInBrainAccordingIHCButNotExpressedInBrainAccordingMicroarray.sparql) which are expressed in brain according to IHC but not expressed in brain according to microarray
* [Q77](src/test/resources/sparql/Q77-expressedInLiverAccordingIHCButNotInHUPOLiverProteom.sparql) which are expressed in liver according to IHC data but not found in HUPO liver proteome set
* [Q83](./src/test/resources/sparql/Q83-expressedOnASingleTissue.sparql) whose genes are on chromosome N that are expressed only a single tissue/organ
* [Q4](src/main/resources/sparql/Q4-highlyExpressedInBrainButNotInTestis.sparql) highly expressed in brain but not expressed in testis
* [Q11](src/main/resources/sparql/Q11-expressedInLiverAndInvolvedInTransport.sparql) that are expressed in liver and involved in transport
* Q[15](src/main/resources/sparql/Q15-PDZdomainthatInteractWithProteinExpresssedInBrain.sparql) with a PDZ domain that interact with at least 1 protein which is expressed in brain
* [Q17](src/main/resources/sparql/Q17-gt1000aaAndLocatedInNucleusAndExpressedInNervousSystem.sparql) >=1000 amino acids and located in nucleus and expression in nervous system
* [Q20](src/main/resources/sparql/Q20-HPAOnChromosome21highlyExpresssedInHeartAtIHCLevel.sparql) with >=2 HPA antibodies whose genes are located on chromosome 21 and that are highly expressed at IHC level in heart
* [Q50](src/main/resources/sparql/Q50-expressedInBrainAccordingIHCButNotExpressedInBrainAccordingMicroarray.sparql) which are expressed in brain according to IHC but not expressed in brain according to microarray
* [Q77](src/main/resources/sparql/Q77-expressedInLiverAccordingIHCButNotInHUPOLiverProteom.sparql) which are expressed in liver according to IHC data but not found in HUPO liver proteome set
* [Q83](./src/main/resources/sparql/Q83-expressedOnASingleTissue.sparql) whose genes are on chromosome N that are expressed only a single tissue/organ
* Q89 which are located in nucleus and expressed in brain and only have orthologs/paralogs in primates

###Use case for [sequence annotations](src/test/java/evaletolab/rdf/Features.java)
* [Q3](src/test/resources/sparql/Q3-with2TransmembraneRegions.sparql) Proteins with >=2 transmembrane regions
* [Q5](src/test/resources/sparql/Q5-locatedInMitochondrionAndLackATransitPeptide.sparql) Proteins located in mitochondrion and that lack a transit peptide
* [Q9](src/test/resources/sparql/Q9-with3DisulfideBondsAndNotHormones.sparql) Proteins with 3 disulfide bonds and that are not hormones
* [Q13](src/test/resources/sparql/Q13-withKinaseDomainButNotKinaseActivity.sparql) Proteins with a protein kinase domain but no kinase activity
* [Q14](src/test/resources/sparql/Q14-with2SH3And1SHD2.sparql) Proteins with 2 SH3 domains and 1 SH2 domain
* [Q15](src/test/resources/sparql/Q15-PDZdomainthatInteractWithProteinExpresssedInBrain.sparql) Proteins with a PDZ domain that interact with at least 1 protein which is expressed in brain
* [Q16](src/test/resources/sparql/Q16-withMature100AAWhichAreSecretedAndNotContainsCysteinesInMature.sparql) Proteins with a mature chain <= 100 amino acids which are secreted and do not contain cysteines in the mature chain
* [Q18](src/test/resources/sparql/Q18-thatAreAcetylatedAndMethylated.sparql) Proteins that are acetylated and methylated and located in the nucleus
* [Q19](src/test/resources/sparql/Q19-containsSignalSequenceFollowedByAExtracellularDomainContainingKRKRMotif.sparql) Proteins contains a signal sequence followed by a extracellular domain containing a "KRKR" motif
###Use case for [sequence annotations](src/main/java/evaletolab/rdf/Features.java)
* [Q3](src/main/resources/sparql/Q3-with2TransmembraneRegions.sparql) Proteins with >=2 transmembrane regions
* [Q5](src/main/resources/sparql/Q5-locatedInMitochondrionAndLackATransitPeptide.sparql) Proteins located in mitochondrion and that lack a transit peptide
* [Q9](src/main/resources/sparql/Q9-with3DisulfideBondsAndNotHormones.sparql) Proteins with 3 disulfide bonds and that are not hormones
* [Q13](src/main/resources/sparql/Q13-withKinaseDomainButNotKinaseActivity.sparql) Proteins with a protein kinase domain but no kinase activity
* [Q14](src/main/resources/sparql/Q14-with2SH3And1SHD2.sparql) Proteins with 2 SH3 domains and 1 SH2 domain
* [Q15](src/main/resources/sparql/Q15-PDZdomainthatInteractWithProteinExpresssedInBrain.sparql) Proteins with a PDZ domain that interact with at least 1 protein which is expressed in brain
* [Q16](src/main/resources/sparql/Q16-withMature100AAWhichAreSecretedAndNotContainsCysteinesInMature.sparql) Proteins with a mature chain <= 100 amino acids which are secreted and do not contain cysteines in the mature chain
* [Q18](src/main/resources/sparql/Q18-thatAreAcetylatedAndMethylated.sparql) Proteins that are acetylated and methylated and located in the nucleus
* [Q19](src/main/resources/sparql/Q19-containsSignalSequenceFollowedByAExtracellularDomainContainingKRKRMotif.sparql) Proteins contains a signal sequence followed by a extracellular domain containing a "KRKR" motif
* Q27 Proteins with >=1 glycosylation sites reported in PubMed:X or PubMed:Y
* [Q32](src/test/resources/sparql/Q32-withCoiledCoiledAndInvolvedInTranscriptionButNotContainBZIP.sparql) Proteins with a coiled coil region and involved in transcription but does not contain a bZIP domain
* [Q34](src/test/resources/sparql/Q34-withHomeoboxAndWithVariantsInTheHomeobox.sparql) Proteins with >=1 homeobox domain and with >=1 variant in the homeobox domain(s)
* [Q35](src/test/resources/sparql/Q35.sparql) Proteins located in the mitochondrion and which is an enzyme
* [Q38](src/test/resources/sparql/Q38.sparql) Proteins with >=1 selenocysteine in their sequence
* [Q39](src/test/resources/sparql/Q39.sparql) Proteins with >=1 mutagenesis in a position that correspond to an annotated active site
* [Q40](src/test/resources/sparql/Q40.sparql) Proteins that are enzymes and with >=1 mutagenesis that "decrease" or "abolish" activity
* [Q41](src/test/resources/sparql/Q41.sparql) Proteins that are annotated with GO "F" terms prefixed by "Not"
* [Q48](src/test/resources/sparql/Q48.sparql) Proteins with >=1 variants of the type "C->" (Cys to anything else) that are linked to >=1 disease
* [Q49](src/test/resources/sparql/Q49.sparql) Proteins with >=1 variants of the types "A->R" or "R->A"

###Use case for general [annotations](src/test/java/evaletolab/rdf/Interaction.java)
* [Q24](src/test/resources/sparql/Q24.sparql) with >1 reported gold interaction
* [Q25](src/test/resources/sparql/Q25.sparql) with >=50 interactors and not involved in a disease
* [Q26](src/test/resources/sparql/Q26.sparql) interacting with >=1 protein located in the mitochondrion
* [Q32](src/main/resources/sparql/Q32-withCoiledCoiledAndInvolvedInTranscriptionButNotContainBZIP.sparql) Proteins with a coiled coil region and involved in transcription but does not contain a bZIP domain
* [Q34](src/main/resources/sparql/Q34-withHomeoboxAndWithVariantsInTheHomeobox.sparql) Proteins with >=1 homeobox domain and with >=1 variant in the homeobox domain(s)
* [Q35](src/main/resources/sparql/Q35.sparql) Proteins located in the mitochondrion and which is an enzyme
* [Q38](src/main/resources/sparql/Q38.sparql) Proteins with >=1 selenocysteine in their sequence
* [Q39](src/main/resources/sparql/Q39.sparql) Proteins with >=1 mutagenesis in a position that correspond to an annotated active site
* [Q40](src/main/resources/sparql/Q40.sparql) Proteins that are enzymes and with >=1 mutagenesis that "decrease" or "abolish" activity
* [Q41](src/main/resources/sparql/Q41.sparql) Proteins that are annotated with GO "F" terms prefixed by "Not"
* [Q48](src/main/resources/sparql/Q48.sparql) Proteins with >=1 variants of the type "C->" (Cys to anything else) that are linked to >=1 disease
* [Q49](src/main/resources/sparql/Q49.sparql) Proteins with >=1 variants of the types "A->R" or "R->A"

###Use case for general [annotations](src/main/java/evaletolab/rdf/Interaction.java)
* [Q24](src/main/resources/sparql/Q24.sparql) with >1 reported gold interaction
* [Q25](src/main/resources/sparql/Q25.sparql) with >=50 interactors and not involved in a disease
* [Q26](src/main/resources/sparql/Q26.sparql) interacting with >=1 protein located in the mitochondrion

###Use case for general [annotations](src/test/java/evaletolab/rdf/General.java)
* [Q1](src/test/resources/sparql/Q1.sparql) that are phosphorylated and located in the cytoplasm
* [Q2](src/test/resources/sparql/Q2.sparql) that are located both in the cytoplasm and in the nucleus
* [Q5](src/test/resources/sparql/Q5.sparql) located in mitochondrion and that lack a transit peptide
* [Q6](src/test/resources/sparql/Q6.sparql) whose genes are on chromosome 2 and linked with a disease
* [Q7](src/test/resources/sparql/Q7.sparql) linked to diseases that are associated with cardiovascular aspects
* [Q8](src/test/resources/sparql/Q8.sparql) whose genes are x bp away from the location of the gene of protein Y
* [Q22](src/test/resources/sparql/Q22.sparql) Proteins with no function annotated
* [Q31](src/test/resources/sparql/Q31.sparql) Proteins with >=10 "splice" isoforms
* [Q32](src/test/resources/sparql/Q32.sparql) Proteins with a coiled coil region and involved in transcription but does not contain a bZIP domain
* [Q68](src/test/resources/sparql/Q68.sparql) with protein evidence PE=2 (transcript level)
* [Q65](src/test/resources/sparql/Q65.sparql) Proteins with >1 catalytic activity
* [Q73](src/test/resources/sparql/Q73.sparql) Proteins with no domain
###Use case for general [annotations](src/main/java/evaletolab/rdf/General.java)
* [Q1](src/main/resources/sparql/Q1.sparql) that are phosphorylated and located in the cytoplasm
* [Q2](src/main/resources/sparql/Q2.sparql) that are located both in the cytoplasm and in the nucleus
* [Q5](src/main/resources/sparql/Q5.sparql) located in mitochondrion and that lack a transit peptide
* [Q6](src/main/resources/sparql/Q6.sparql) whose genes are on chromosome 2 and linked with a disease
* [Q7](src/main/resources/sparql/Q7.sparql) linked to diseases that are associated with cardiovascular aspects
* [Q8](src/main/resources/sparql/Q8.sparql) whose genes are x bp away from the location of the gene of protein Y
* [Q22](src/main/resources/sparql/Q22.sparql) Proteins with no function annotated
* [Q31](src/main/resources/sparql/Q31.sparql) Proteins with >=10 "splice" isoforms
* [Q32](src/main/resources/sparql/Q32.sparql) Proteins with a coiled coil region and involved in transcription but does not contain a bZIP domain
* [Q68](src/main/resources/sparql/Q68.sparql) with protein evidence PE=2 (transcript level)
* [Q65](src/main/resources/sparql/Q65.sparql) Proteins with >1 catalytic activity
* [Q73](src/main/resources/sparql/Q73.sparql) Proteins with no domain
###Use case for PTM queries


Expand Down
9 changes: 7 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.8.v20121106</version>
<configuration>
<scanIntervalSeconds>1</scanIntervalSeconds>
<scanIntervalSeconds>0</scanIntervalSeconds>
<!-- Context path is / by default -->
<!-- <webApp> -->
<!-- <contextPath>/${project.artifactId}</contextPath> -->
Expand Down Expand Up @@ -205,7 +205,12 @@
<version>1.3</version>
</dependency>


<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.9-RC1</version>
</dependency>

</dependencies>

</project>
26 changes: 25 additions & 1 deletion src/main/java/evaletolab/controller/SparqlController.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
package evaletolab.controller;

import java.io.Console;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.regex.Pattern;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.reflections.Reflections;
import org.reflections.scanners.ResourcesScanner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
Expand Down Expand Up @@ -58,6 +67,21 @@ public String home() {
return "/home";
}

@RequestMapping(value = "/sparql/queries", method = RequestMethod.GET)
public @ResponseBody List<Map<String,String>> queries(HttpServletRequest request, HttpServletResponse response) throws Exception {
List<Map<String,String>> result=new ArrayList<Map<String,String>>();
Set<String> sparqls =new Reflections("sparql", new ResourcesScanner()).getResources(Pattern.compile(".*\\.sparql"));
Map<String,String> meta=new HashMap<String, String>();
for(String q:sparqls){
String query=FileUtil.getResourceAsString(q);
meta.put("title", getMetaInfo(query).get("title"));
meta.put("query", query);
result.add(meta);
meta=new HashMap<String, String>();
}
return result;
}

@RequestMapping(value = "/entry/{ac}", method = RequestMethod.GET)
public String entry(HttpServletRequest request, HttpServletResponse response,
@PathVariable("ac") String ac,
Expand All @@ -73,7 +97,7 @@ public String entry(HttpServletRequest request, HttpServletResponse response,
@PathVariable("ac") String ac,
@RequestParam(value="output", required=false) String output) throws Exception {

String q=FileUtil.getResourceAsString("sparql/entry.sparql").replaceAll("NX_VALUE", ac);;
String q=FileUtil.getResourceAsString("sparql.services/entry.sparql").replaceAll("NX_VALUE", ac);;

if (output!=null && output.equalsIgnoreCase("json")){
response.setHeader("Accept", "application/sparql-results+json");
Expand Down
Loading

0 comments on commit ba206c6

Please sign in to comment.