Skip to content

Commit

Permalink
Adapted metadata query to pathways
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarinllao committed Oct 8, 2018
1 parent 5bea1df commit 0a4d7b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pathme/reactome/rdf_sparql.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@

#: SPARQL query to get all the possible metadate (optional statements) of an entity (Protein, Dna, Pathway...).
GET_ENTITY_METADATA = """
SELECT DISTINCT (STRAFTER(STR(?entity), '#') AS ?identifier) (STR(?entity) AS ?uri_reactome_id) ?uri_id ?name ?identifier ?cell_locat ?display_name ?complex_components ?comment (STRAFTER (STR(?uri_type), str(biopax3:)) AS ?entity_type)
SELECT DISTINCT (STRAFTER(STR(?entity), '#') AS ?identifier) (STR(?entity) AS ?uri_reactome_id) (STR(?entity) AS ?uri_id) (STR(?entity_reference) AS ?uri_id) ?name ?cell_locat ?display_name ?complex_components ?comment (STRAFTER (STR(?uri_type), str(biopax3:)) AS ?entity_type)
WHERE
{
?entity rdf:type ?uri_type .
?entity biopax3:comment ?comment .
optional {?entity biopax3:comment ?comment .}
optional {?entity biopax3:entityReference ?uri_id .}
optional {?entity biopax3:entityReference ?entity_reference .}
optional {?entity biopax3:name ?name .}
optional {?entity biopax3:displayName ?display_name .}
Expand Down Expand Up @@ -117,7 +117,7 @@ def _get_all_entry_types(rdf_graph: rdflib.Graph) -> Set[str]:
}


def _get_pathway_metadata(pathway_uri: str, rdf_graph: rdflib.Graph) -> Dict[str, Union[str, Set[str]]]:
def _get_pathway_metadata(pathway_uri: str, rdf_graph: rdflib.Graph) -> Dict[str, Dict[str, Dict[str, str]]]:
"""Get metadata for a pathway entry.
:param pathway_uri: URI reference of the queried graph
Expand All @@ -130,7 +130,7 @@ def _get_pathway_metadata(pathway_uri: str, rdf_graph: rdflib.Graph) -> Dict[str
initNs=PREFIXES,
initBindings={'entity': pathway_uri}
),
attr_empty=['display_name', 'identifier', 'uri_reactome_id', 'comment'],
attr_empty=['display_name', 'identifier', 'uri_id', 'uri_reactome_id', 'comment'],
id_dict=False
)

Expand Down

0 comments on commit 0a4d7b3

Please sign in to comment.