Skip to content

Commit

Permalink
fixed BASE URI for SPARQL queries
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelarmande committed Aug 30, 2024
1 parent e95054d commit 78d18cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions agrold-javaweb/src/main/java/agrold/webservices/dao/QtlDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
public class QtlDAO {

public static final String QTL_TYPE_URI2 = "http://purl.obolibrary.org/obo/SO_0000771";
public static final String QTL_TYPE_URI = "http://www.southgreen.fr/agrold/resource/QTL";
public static final String QTL_TYPE_URI = "http://purl.agrold.org/vocabulary/QTL";
public static final String[] TYPEURIs = new String[]{QTL_TYPE_URI, QTL_TYPE_URI2};

// return URIs and agrold_vocabulary:description of all genes in Agrold
public static String getQtls(int page, int pageSize, String resultFormat) throws IOException {

String sparqlQuery = "PREFIX agrold:<http://www.southgreen.fr/agrold/vocabulary/> \n"
String sparqlQuery = "PREFIX agrold:<http://purl.agrold.org/vocabulary/> \n"
+ "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>\n"
+ "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n"
+ "SELECT distinct ?qtlId ?qtlName (group_concat(distinct ?d;separator=\"; \") as ?Description) (?qtl AS ?URI)\n"
Expand Down Expand Up @@ -62,7 +62,7 @@ public static String getQtlIdAssociatedWithOntoId(String ontoId, int page, int p
// + " BIND(REPLACE(str(?qtl), '^.*(#|/)', \"\") AS ?qtlId) .\n"
// + " }\n"
// + "}";
String sparqlQuery = "BASE <http://www.southgreen.fr/agrold/>\n"
String sparqlQuery = "BASE <http://purl.agrold.org/>>\n"
+ "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n"
+ "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>\n"
+ "SELECT DISTINCT ?qtlId (?qtl AS ?URI) ?qtlLabel (REPLACE(str(?predicate), '^.*(#|/)', \"\") AS ?Association) "
Expand All @@ -72,9 +72,9 @@ public static String getQtlIdAssociatedWithOntoId(String ontoId, int page, int p
+ " {\n"
+ " ?qtl ?predicate ?ontoElt .\n"
+ " ?ontoElt rdfs:subClassOf ?ontoEltClass.\n"
+ " {?qtl rdf:type <http://www.southgreen.fr/agrold/resource/QTL>.}\n"
+ " {?qtl rdf:type <"+QTL_TYPE_URI+">.}\n"
+ " UNION\n"
+ " {?qtl rdfs:subClassOf <http://purl.obolibrary.org/obo/SO_0000771>.}\n"
+ " {?qtl rdfs:subClassOf <"+QTL_TYPE_URI2+">.}\n"
+ " optional {?ontoElt rdfs:label ?ontoLabel}\n"
+ " optional {?qtl rdfs:label ?qtlLabel}\n"
+ " BIND(REPLACE(str(?qtl), '^.*(#|/)', \"\") AS ?qtlId) .\n"
Expand All @@ -88,7 +88,7 @@ public static String getQtlIdAssociatedWithOntoId(String ontoId, int page, int p
}

public static String getQtlsAssociatedWithProteinId(String proteinId, int page, int pageSize, String resultFormat) throws IOException {
String sparqlQuery = "BASE <http://www.southgreen.fr/agrold/>\n"
String sparqlQuery = "BASE <http://purl.agrold.org/>\n"
+ "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>\n"
+ "PREFIX vocab:<vocabulary/>\n"
+ "PREFIX graph1:<protein.annotations>\n"
Expand Down

0 comments on commit 78d18cd

Please sign in to comment.