Skip to content

Commit

Permalink
Add contributor, group fields for #11
Browse files Browse the repository at this point in the history
  • Loading branch information
dustine32 committed Oct 10, 2022
1 parent f83aeda commit 9244bb6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ app.get('/models', function(req, res) {
utils.fetchAndSend(res, sparqlPMIDs.PMIDModelList(req.query.pmid), false, keysArrayModels);
// // send the models with at least 2 causal MF-MFs (recent addition, code below would have to be clean and merge with new API)
} else if(req.query.causalmf) {
utils.fetchAndSend(res, sparqlModels.ModelsWith2CausalMFs(req.query.causalmf), false);
utils.fetchAndSend(res, sparqlModels.ModelsWith2CausalMFs(req.query.causalmf), false, keysArrayModels);

// send all models
} else {
Expand Down
18 changes: 16 additions & 2 deletions queries/sparql-models.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ module.exports = {
PREFIX immediately_causally_upstream_of: <http://purl.obolibrary.org/obo/RO_0002412>
PREFIX directly_provides_input_for: <http://purl.obolibrary.org/obo/RO_0002413>
SELECT distinct ?gocam ?date ?title
SELECT ?gocam ?date ?title (GROUP_CONCAT(distinct ?orcid;separator="` + separator + `") AS ?orcids)
(GROUP_CONCAT(distinct ?name;separator="` + separator + `") AS ?names)
(GROUP_CONCAT(distinct ?providedBy;separator="` + separator + `") AS ?groupids)
(GROUP_CONCAT(distinct ?providedByLabel;separator="` + separator + `") AS ?groupnames)
WHERE
{
Expand All @@ -369,14 +372,25 @@ module.exports = {
?gocam metago:graphType metago:noctuaCam .
?gocam dc:date ?date .
?gocam dc:title ?title .
?gocam dc:contributor ?orcid .
?gocam providedBy: ?providedBy .
BIND( IRI(?orcid) AS ?orcidIRI ).
BIND( IRI(?providedBy) AS ?providedByIRI ).
?ind1 ?causal1 ?ind2 .
?ind2 ?causal2 ?ind3
}
?ind1 rdf:type MF: .
?ind2 rdf:type MF: .
?ind3 rdf:type MF:
?ind3 rdf:type MF: .
optional {
?providedByIRI rdfs:label ?providedByLabel .
}
optional { ?orcidIRI rdfs:label ?name }
BIND(IF(bound(?name), ?name, ?orcid) as ?name) .
}
}
GROUP BY ?gocam ?date ?title
ORDER BY ?gocam
`);
return "?query=" + encoded;
Expand Down

0 comments on commit 9244bb6

Please sign in to comment.