tetherless-world / nanomine-graph

the visualization web app for nanomine project
MIT License
1 stars 4 forks source link

Preserve author order when importing from XML into KG #17

Open mdeagen opened 4 years ago

mdeagen commented 4 years ago

Authors are currently stored as individual triples with dct:creator, and the author order as listed in the original publication is not preserved.

For shorthand citation purposes, it is often useful to state FirstAuthor et al. (Year), therefore preserving the sequence information is needed here (e.g., as an RDF list)

mdeagen commented 4 years ago

Author lists have been implemented, but appears to store REVERSE order of authors in the knowledge graph.

The expected SPARQL query for first author would be:

PREFIX bibo: <http://purl.org/ontology/bibo/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT * WHERE {  
    ?doi bibo:authorList [rdf:first ?firstAuthor] .
}

The expected query for last author would be:

PREFIX bibo: <http://purl.org/ontology/bibo/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT * WHERE {  \
    ?doi bibo:authorList/rdf:rest* [rdf:first ?lastAuthor;
                                    rdf:rest rdf:nil ] .
}
mdeagen commented 4 years ago

Printing the full author list via SPARQL would be useful, but it appears that GROUP_CONCAT does not handle ordered lists in SPARQL 1.1 (the printed order is random)