opencitations / website

The code and content of the official website of OpenCitations
1 stars 3 forks source link

Querying the OCC for PMID and PMCID #8

Closed essepuntato closed 6 years ago

essepuntato commented 6 years ago

From https://twitter.com/sckottie/status/982014206600871936

Anyone have e.g. of doing @opencitations corpus Sparql queries (http://opencitations.net/sparql ) ? How to get all other identifiers for an article from a single identifier, e.g, get pmid and pmcid for a given doi

essepuntato commented 6 years ago
PREFIX datacite: <http://purl.org/spar/datacite/>
PREFIX literal: <http://www.essepuntato.it/2010/06/literalreification/>
SELECT ?paper ?pmid ?pmcid WHERE {
  ?paper datacite:hasIdentifier [ 
      datacite:usesIdentifierScheme datacite:doi ;
      literal:hasLiteralValue "10.1097/igc.0000000000000609"
  ] .

  OPTIONAL {
    ?paper datacite:hasIdentifier [ 
      datacite:usesIdentifierScheme datacite:pmid ;
      literal:hasLiteralValue ?pmid
    ] .
  }

  OPTIONAL {
    ?paper datacite:hasIdentifier [ 
      datacite:usesIdentifierScheme datacite:pmcid ;
      literal:hasLiteralValue ?pmcid
    ] .
  }
}