BibTeX mapping
From Bibliographic Ontology Wiki
The following is rather preliminary, but a suggested mapping from BibTeX to BIBO. The reverse can be used for a lossless conversion BibTeX->BIBO->BibTeX, or a lossy conversion from BibTeX, though it may need rudimentary inference support in the converter for the latter.
Contents |
[edit] Key
These mappings are in the format:
<BibTeX-property> → <SPARQL-representation> <SPARQL-representation> → <BibTeX-property> (<notes-on-mappings>)
Values of properties are specified as ?value and the subject (arbitrarily assigned a URI) is marked as ?subject. Irrelevant nodes (for the purpose of mapping back to BibTeX), are marked as ?a with increasing letters.
Notes are provided in parentheses following the SPARQL-representation.
Namespaces used are the following:
@prefix bibo: <http://purl.org/ontology/bibo/> . @prefix bibo_degrees: <http://purl.org/ontology/bibo/degrees/> . @prefix bibo_roles: <http://purl.org/ontology/bibo/roles/> . @prefix bibo_status: <http://purl.org/ontology/bibo/status/> . @prefix dcterms: <http://purl.org/dc/terms/> .
[edit] Citation Types
@article → ?subject a bibo:Article .
?subject a bibo:Article ;
dcterms:isPartOf ?a .
?a a bibo:Journal .
→ @article
@book → ?subject a bibo:Book .
?subject a bibo:Book ;
dcterms:publisher ?a .
→ @book
@booklet → ?subject a bibo:Book .
?subject a bibo:Book .
OPTIONAL { ?subject dcterms:publisher ?a . }
FILTER (!bound(?a))
→ @book
(Uncertain whether bibo:Book is the right mapping. Need to ensure that dcterms:publisher property is never set for booklets.)
@conference → ?subject a bibo:Article .
?subject a bibo:Article .
OPTIONAL { ?subject dcterms:isPartOf ?a .
?a a bibo:Journal . }
FILTER (!bound(?a))
→ @conference
(This should be an approprate mapping. Maybe later ensure that (?a a bibo:Book .), but may conflict with the below.)
@inbook → ?subject a bibo:Article .
?subject a bibo:Article ;
dcterms:isPartOf ?a .
?a a bibo:Book .
OPTIONAL { ?subject dcterms:title ?b . }
FILTER (!bound(?b)) .
→ @inbook
(Uncertain whether bibo:Article is the right mapping. May need bibo:Chapter, but may not even refer to a chapter,
so it may not be terribly useful there.)
@incollection → ?subject a bibo:Article .
?subject a bibo:Article ;
dcterms:isPartOf ?a ;
dcterms:title ?b .
?a a bibo:Book .
→ @incollection
(Almost certainly needs to be bibo:Chapter)
@inproceedings → ?subject a bibo:Article .
?subject a bibo:Article .
OPTIONAL { ?subject dcterms:isPartOf ?a .
?a a bibo:Journal . }
FILTER (!bound(?a))
→ @inproceedings
(No way to differentiate @inproceedings from @conference in the reverse mapping, but this may be irrelevant.
Favor @conference in reverse mapping.)
@manual → ?subject a bibo:Manual . ?subject a bibo:Manual . → @journal
@mastersthesis →
?subject a bibo:Thesis ;
bibo:degree bibo_degrees:master .
?subject a bibo:Thesis ;
bibo:degree bibo_degrees:master .
→ @mastersthesis
@misc → ?subject a bibo:Document . ?subject a bibo:Document → @misc (Use inferencing to do this. That way, @misc becomes a catchall for unsupported types in BibTeX.)
@phdthesis →
?subject a bibo:Thesis ;
bibo:degree bibo_degrees:phd .
?subject a bibo:Thesis ;
bibo:degree bibo_degrees:phd . → @phdthesis
@proceedings → ?subject a bibo:Book .
?subject a bibo:Book ;
OPTIONAL { ?subject bibo:contribution ?a .
?a a bibo:Contribution ;
bibo:role bibo_roles:author . }
FILTER (!bound(?a))
→ @proceedings
(The reverse mapping on this is very difficult, as @book may not have an author if it has an editor. More research needed.)
@techreport → ?subject a bibo:TechReport . ?subject a bibo:TechReport → @techreport
@unpublished →
?subject a bibo:Document ;
bibo:status bibo_status:unpublished .
?subject a bibo:Document ;
bibo:status bibo_status:unpublished .
→ @unpublished
(Like @misc, use inferences to catch this, but catch it before everything, rather than after everything.)
TODO: @patent, @collection
[edit] Properties
[edit] Introduction
Properties need to be handled with a bit more care than the above types, as there are more syntactic issues to be aware of. There are some core principles that may OPTIONALLY be followed, depending on how strictly you want to unify bnodes. These include:
- Any one citation that is mapped should contain at most ONE dcterms:publisher and dcterms:isPartOf property. Any of the below mappings that generate such a property should map onto the existing object of a previously created instance of the property. For example:
address = "an address" publisher = "a publisher"
should map to:
?subject dcterms:publisher ?a . ?a a foaf:Agent ; bibo:locality "an address" ; foaf:name "a publisher" .
and NOT:
?subject dcterms:publisher ?a . ?a a foaf:Agent ; bibo:locality "an address" ; ?subject dcterms:publisher ?b . ?b a foaf:Agent ; foaf:name "a publisher" .
- Objects of dcterms:publisher and dcterms:isPartOf may be unified if ALL of the properties of two separate objects are identical (thus eliminating excess bnodes):
?subject1 dcterms:publisher ?a . ?subject2 dcterms:publisher ?a . ?a a foaf:Agent ; bibo:locality "an address" ; foaf:name "a publisher" .
and NOT:
?subject1 dcterms:publisher ?a . ?subject2 dcterms:publisher ?b . ?a a foaf:Agent ; bibo:locality "an address" ; foaf:name "a publisher" . ?b a foaf:Agent ; bibo:locality "an address" ; foaf:name "a publisher" .
- Many of the properties that generate an intermediate object (such as dcterms:publisher and dcterms:isPartOf) may generate either a bnode or a node specified with a URI. The latter is easier if unifying like in the above.
publisher = "a publisher"
may become either
?subject dcterms:publisher [ a foaf:Agent ;
foaf:name "a publisher ] .
or
?subject dcterms:publisher <some-URI> . <some-URI> a foaf:Agent ; foaf:name "a publisher" .
The inverse mapping SPARQL query should work with either formulation, which is why either is fine.
- Do NOT unify objects of bibo:contributor, as it is rare to have more information than a name, which may unify much more information than may be preferred.
[edit] Standard Mappings
Most properties have a default mapping, but for some citation types, the mapping is different. Listed below are the standard mappings. Special case mappings should be handled preferentially to these, however.
address → ?subject dcterms:publisher ?a . ?a a foaf:Agent ; bibo:locality ?value . ?subject dcterms:publisher ?a . ?a bibo:locality ?value . → address (Note that there should only be one dcterms:publisher property per subject. Other values that rely on the dcterms:publisher property, such as publisher, should be mapped to the same object.)
annote (This property needs discussion. Its description is 'An annotation for annotated bibliography styles (not typical)'
author →
?subject bibo:contribution [ a bibo:Contribution ;
bibo:contributor [ a foaf:Agent ;
foaf:name ?value ] ;
bibo:role bibo_roles:author ;
bibo:position ?position ] .
?subject bibo:contribution [ a bibo:Contribution ;
bibo:contributor [ a foaf:Agent ;
foaf:name ?value ] ;
bibo:role bibo_roles:author ;
bibo:position ?position ] .
→ author
(Author is a particularly interesting case. The value should be split on ' and ' to obtain all author names.
Subsequently, the position should be placed in ?position (e.g. the first author in the list is given bibo:position 1,
the second, bibo:position 2, etc.) and the name in ?value.
The opposite operation should be performed in the opposite case. Names should be pulled from ?value and
ordered according to bibo:position before being conjoined with ' and '.)
booktitle → ?subject dcterms:isPartOf ?a . ?a a bibo:Book ; dcterms:title ?value . ?subject dcterms:isPartOf ?a . ?a a bibo:Book ; dcterms:title ?value . → booktitle (Like publisher, only one dcterms:isPartOf property should exist for this mapping, and all other properties that use this should map all properties to the same object of the dcterms:isPartOf property. Furthermore, like publisher, objects with the same exact properties should be considered identical.)
chapter (chapter cannot be mapped because we lack bibo:chapter currently.)
crossref (crossref is pretty generic, so I don't know exactly what to do with it... rdfs:seeAlso?)
edition → ?subject bibo:edition ?value . ?subject bibo:edition ?value . → edition
editor →
?subject bibo:contribution [ a bibo:Contribution ;
bibo:contributor [ a foaf:Agent ;
foaf:name ?value ] ;
bibo:role bibo_roles:editor ;
bibo:position ?position ] .
?subject bibo:contribution [ a bibo:Contribution ;
bibo:contributor [ a foaf:Agent ;
foaf:name ?value ] ;
bibo:role bibo_roles:editor ;
bibo:position ?position ] .
→ editor
(editor is treated just like author. Split on ' and ' and then specify bibo:position.)
eprint (Not sure how this is used.)
howpublished (Not sure how this is used.)
institution → ?subject bibo:producer ?value . ?subject bibo:producer ?value . → institution (Believe this is correct.)
journal → ?subject dcterms:isPartOf ?a . ?a a bibo:Journal ; dcterms:title ?value . ?subject dcterms:isPartOf ?a . ?a a bibo:Journal ; dcterms:title ?value . → journal
key (Not sure how to handle.)
month → ?subject dcterms:issued ?value . ?subject dcterms:issued ?value . → month (This ONLY works if year is specified. Otherwise, how can we store it? Also, the month should be EMBEDDED in the ISO form of ?value.)
note (Not sure how to handle.)
number → ?subject bibo:number ?value . ?subject bibo:number ?value . → number
organization (Not sure how to handle.)
pages →
?subject bibo:pageStart ?value ;
bibo:pageEnd ?value .
OR
?subject bibo:pages ?value .
?subject bibo:pageStart ?value ;
bibo:pageEnd ?value .
OR
?subject bibo:pages ?value .
→ pages
(For the former option, only one 'pagespan' of the form 'pageStart--pageEnd' should be specified and parsed.
if the specification is any more complex, bibo:pages should be used.)
publisher → ?subject dcterms:publisher ?a . ?a a foaf:Agent ; foaf:name ?value . ?subject dcterms:publisher ?a . ?a foaf:name ?value . → publisher
school (Not sure how to handle.)
series → ?subject dcterms:isPartOf ?a . ?a a bibo:Collection ; dcterms:title ?value . ?subject dcterms:isPartOf ?a . ?a a bibo:Collection ; dcterms:title ?value . → series
title → ?subject dcterms:title ?value . ?subject dcterms:title ?value . → title
type (Not sure how to handle.)
url → ?subject bibo:uri ?value . ?subject bibo:uri ?value . → url (Caution, should check for presence of URL, not URI, when mapping back.)
volume ?rarr; ?subject bibo:volume ?value . ?subject bibo:volume ?value . → volume
year ?rarr; ?subject dcterms:issued ?value . ?subject dcterms:issued ?value . → year (Map together with month value.)
TODO: More properties...
[edit] Special Case Mappings
Several mappings are 'special cases' and depend on other facts to determine the mapping:
@article { number } → ?subject bibo:issue ?value .
?subject a bibo:Article ;
?subject bibo:issue ?value .
→ @article { number }
@booklet { address }
(Not sure how to map.)
@conference/@inproceedings/@inbook/@incollection
(All properties other than author, booktitle, title, chapter, pages, and edition should be mapped to the object
of the respective dcterms:isPartOf property.
For example:
@inbook { publisher } →
?subject dcterms:isPartOf ?a .
?a a bibo:Book ;
?a dcterms:publisher ?b .
?b a foaf:Agent ;
?b foaf:name ?value .
?subject dcterms:isPartOf ?a .
?a a bibo:Book ;
?a dcterms:publisher ?b .
?b a foaf:Agent ;
?b foaf:name ?value .
→ @inbook { publisher }

