Closed danidi closed 9 years ago
(my notes):
Example of 500 error: https://beta.openphacts.org/1.4/pathways/byReference?uri=http%3A%2F%2Fidentifiers.org%2Fpubmed%2F9789062&app_id=XXXX&app_key=XXXX&pathway_organism=Homosapiens
gives:
Puelia: an implementation of the Linked Data API Internal Server Error Sorry, there was an internal error in serving this request, possibly due to an upstream server, or a configuration error.
It happens no matter what pathway_organism
is specified (ie. probably not due to escaping of the space in Homo%20sapiens
).
Testing on ops2, I get a 404 for any pathway_organism
specified:
Yet of course this should work, as "Homo sapiens" is listed as the pathway_organism
in http://ops2.few.vu.nl/pathways/byReference?uri=http%3A%2F%2Fidentifiers.org%2Fpubmed%2F9789062
<?xml version="1.0" ?>
<result format="linked-data-api" href="http://ops2.few.vu.nl/pathways/byReference?uri=http%3A%2F%2Fidentifiers.org%2Fpubmed%2F9789062&_page=1" version="1.4">
<label>Pathways for Publication: List</label>
<first href="http://ops2.few.vu.nl/pathways/byReference?uri=http%3A%2F%2Fidentifiers.org%2Fpubmed%2F9789062&_page=1"/>
<type href="http://purl.org/linked-data/api/vocab#Page"/>
<items>
<item href="http://rdf.wikipathways.org/Pathway/WP1533_r49537">
<page href="http://www.wikipathways.org/instance/WP1533_r49537"/>
<pathwayOntology>
<item href="http://purl.obolibrary.org/obo/DOID_13381"/>
<item href="http://purl.obolibrary.org/obo/PW_0000397"/>
</pathwayOntology>
<pathway_organism href="http://purl.obolibrary.org/obo/NCBITaxon_9606">
<label datatype="string">Homo sapiens</label>
</pathway_organism>
(Further notes):
Seems to be cause by filtering on the wrong variable:
wp:organism api:name "pathway_organism" ;
api:label "pathway_organism" ;
api:value "The rdfs:label for the pathway organism (URL encode). e.g.: Homo sapiens." ;
api:filterVariable "?item";
a rdf:Property .
yet filtering on ?organism_uri
(or ?organism
) doesn't work - is it because the organism label is typed as rdfs:string? (in the SPARQL query I have to add ^^xsd:string) to get results.
Edit: Still learning this.. my apologies. The filterVariable
was correct as it is the ?item
that has wp:organism
. Still investigating..
Error log is not happy if pathway_organism is included:
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): Entity: line 206: parser error : Opening and ending tag mismatch: HR line 206 and body in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.22</h3></body> in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): ^ in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): Entity: line 206: parser error : Opening and ending tag mismatch: HR line 1 and html in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.22</h3></body></html> in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): ^ in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): Entity: line 206: parser error : Premature end of data in tag body line 1 in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.22</h3></body></html> in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): ^ in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): Entity: line 206: parser error : Premature end of data in tag html line 1 in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.22</h3></body></html> in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Warning: simplexml_load_string(): ^ in /var/www/html/ops_ims.class.php on line 176
[Mon Dec 01 14:14:57 2014] [error] [client 84.92.48.26] PHP Notice: Trying to get property of non-object in /var/www/html/ops_ims.class.php on line 176
Seems we get a 500 error from the IMS.
If I leave out the organism_name it instead expands fine:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><URL><expandedQuery>CONSTRUCT {
?item<http://purl.org/dc/elements/1.1/title> ?title .
?item<http://vocabularies.wikipathways.org/wp#organism> ?organism_uri .
?item<http://xmlns.com/foaf/0.1/page> ?page .
?item<http://purl.org/dc/elements/1.1/identifier> ?identifier .
?item<http://purl.org/dc/terms/description> ?description .
?item<http://vocabularies.wikipathways.org/wp#pathwayOntology> ?ontology .
?item<http://purl.org/dc/terms/hasPart> ?pw_uri .
?item<http://rdfs.org/ns/void#inDataset> <http://www.wikipathways.org> .
?organism_uri<http://www.w3.org/2000/01/rdf-schema#label> ?organism .
?pw_uri<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vocabularies.wikipathways.org/wp#PublicationReference> . }
WHERE {
GRAPH <http://www.wikipathways.org> {
?item <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vocabularies.wikipathways.org/wp#Pathway> .
?item <http://purl.org/dc/elements/1.1/title> ?title .
?item <http://vocabularies.wikipathways.org/wp#organism> ?organism_uri .
?item <http://xmlns.com/foaf/0.1/page> ?page .
?item <http://purl.org/dc/elements/1.1/identifier> ?identifier .
?pw_uri <http://purl.org/dc/terms/isPartOf> ?item .
?pw_uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://vocabularies.wikipathways.org/wp#PublicationReference> .
?organism_uri <http://www.w3.org/2000/01/rdf-schema#label> ?organism .
OPTIONAL {
?item <http://purl.org/dc/terms/description> ?description .
}
OPTIONAL {
?item <http://vocabularies.wikipathways.org/wp#pathwayOntology> ?ontology .
}
FILTeR (?pw_uri = <http://identifiers.org/pubmed/11967526>)
}
}
</expandedQuery><orginalQuery>PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
CONSTRUCT { ?item dc:title ?title ;
wp:organism ?organism_uri ;
foaf:page ?page ;
dc:identifier ?identifier ;
dcterms:description ?description ;
wp:pathwayOntology ?ontology ;
dcterms:hasPart ?pw_uri ;
void:inDataset <http://www.wikipathways.org> .
?organism_uri rdfs:label ?organism .
?pw_uri a wp:PublicationReference .
} WHERE { GRAPH <http://www.wikipathways.org> {
?item a wp:Pathway ;
dc:title ?title ;
wp:organism ?organism_uri ;
foaf:page ?page ;
dc:identifier ?identifier .
?pw_uri dcterms:isPartOf ?item ;
a wp:PublicationReference .
?organism_uri rdfs:label ?organism .
OPTIONAL { ?item dcterms:description ?description }
OPTIONAL { ?item wp:pathwayOntology ?ontology }
} }</orginalQuery></URL>
SELECT DISTINCT ?item WHERE {GRAPH <http://www.wikipathways.org> { { ?item<http://vocabularies.wikipathways.org/wp#organism> "Homo Sapiens". *#*
...
root cause
org.openrdf.query.MalformedQueryException: Encountered " "*" "* "" at line 6, column 143.
Was expecting one of:
@Christian-B any idea on what that "*"
thing is meant to be..? Sorry for being clueless!
edit: Never mind - *#*
is meant to be replaced with }
by expandQueryThroughExpander()
on the PHP side.. Comments in code as to why would be nice. :)
Fixed. Bug in ops_ims.class.php
in that "*"
was not replaced before passing to IMS.
Deployed on ops2 / devel
. Could you check, @danidi ? Please also paste the URIs that work/don't work.
The organism names that are supported are:
<http://purl.obolibrary.org/obo/NCBITaxon_7165> api:name "Anopheles gambiae" .
<http://purl.obolibrary.org/obo/NCBITaxon_3702> api:name "Arabidopsis thaliana" .
<http://purl.obolibrary.org/obo/NCBITaxon_1423> api:name "Bacillus subtilis" .
<http://purl.obolibrary.org/obo/NCBITaxon_9913> api:name "Bos taurus" .
<http://purl.obolibrary.org/obo/NCBITaxon_6239> api:name "Caenorhabditis elegans" .
<http://purl.obolibrary.org/obo/NCBITaxon_9615> api:name "Canis familiaris" .
<http://purl.obolibrary.org/obo/NCBITaxon_7955> api:name "Danio rerio" .
<http://purl.obolibrary.org/obo/NCBITaxon_7227> api:name "Drosophila melanogaster" .
<http://purl.obolibrary.org/obo/NCBITaxon_9796> api:name "Equus caballus" .
<http://purl.obolibrary.org/obo/NCBITaxon_9031> api:name "Gallus gallus" .
<http://purl.obolibrary.org/obo/NCBITaxon_5518> api:name "Gibberella zeae" .
<http://purl.obolibrary.org/obo/NCBITaxon_9606> api:name "Homo sapiens" .
<http://purl.obolibrary.org/obo/NCBITaxon_10090> api:name "Mus musculus" .
<http://purl.obolibrary.org/obo/NCBITaxon_1773> api:name "Mycobacterium tuberculosis" .
<http://purl.obolibrary.org/obo/NCBITaxon_4530> api:name "Oryza sativa" .
<http://purl.obolibrary.org/obo/NCBITaxon_9598> api:name "Pan troglodytes" .
<http://purl.obolibrary.org/obo/NCBITaxon_10116> api:name "Rattus norvegicus" .
<http://purl.obolibrary.org/obo/NCBITaxon_4932> api:name "Saccharomyces cerevisiae" .
<http://purl.obolibrary.org/obo/NCBITaxon_4577> api:name "Zea mays" .
Thank you! I tested:
Count calls show the same behaviour: single organisms work fine, multiple organisms separated by | return 0 results (although there should be more). Should I raise this as a different issue? The main issue seems to be solved.
I didn't know multiple organisms were meant to be supported - that sounds like a new feature request. Could you raise that separately, @danidi ?
The pathways for target/compound/publication API calls return error code 500 when the pathway_organism parameter is defined (e.g. with Homo sapiens). It works fine in the general "Pathways: List" call.