Closed khider closed 1 year ago
Still missing the authors...
Can you give me some example code. Unable to replicate
On Fri, 24 Feb 2023, 04:02 Deborah Khider, @.***> wrote:
Reopened #25 https://github.com/LinkedEarth/pylipd/issues/25.
— Reply to this email directly, view it on GitHub https://github.com/LinkedEarth/pylipd/issues/25#event-8596516128, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGTB6QXREC6CJHV6GK6PQMTWY7QODANCNFSM6AAAAAAVDXYXCE . You are receiving this because you modified the open/close state.Message ID: @.***>
from pylipd.lipd import LiPD
from doi2bib import crossref
from pybtex.database import BibliographyData, Entry
import io
import re
import random
import string
L = LiPD()
data = ['https://lipdverse.org/data/TjhHrDv0LQ4aazHolZkR/1_0_0//Ocn-WEqPacific.Stott.2007.lpd',
'/Users/deborahkhider/Documents/GitHub/PyleoTutorials/data/Ocn-Palmyra.Nurhati.2011.lpd']
L.load(data)
L.set_endpoint("https://linkedearth.graphdb.mint.isi.edu/repositories/LiPDVerse2")
L.load_remote_datasets(["MD98_2181.Stott.2007","NAm-SmithersSkiArea.Schweingruber.1996",
"NAm-CeaderBreaks.Briffa.1996", "ODP1671017E",
"SPC14.Kahle.2021", "RC12-10.Poore.2003",
"MD02-2553.Poore.2009", "AD9117.Guinta.2001",
"SchellingsBog.Barron.2004", "Hidden.Tang.1999"])
query = """PREFIX le: <http://linked.earth/ontology#>
select ?author ?doi ?year ?pubyear ?title ?journal ?volume ?issue ?pages ?type ?publisher ?report ?citeKey ?edition ?institution where {
?ds a le:Dataset .
?ds le:publishedIn ?pub .
OPTIONAL{?pub le:hasDOI ?doi .}
OPTIONAL{?pub le:author ?author .}
OPTIONAL{?pub le:publicationYear ?year .}
OPTIONAL{?pub le:pubYear ?pubyear .}
OPTIONAL{?pub le:title ?title .}
OPTIONAL{?pub le:journal ?journal .}
OPTIONAL{?pub le:volume ?volume .}
OPTIONAL{?pub le:issue ?issue .}
OPTIONAL{?pub le:pages ?pages .}
OPTIONAL{?pub le:type ?type .}
OPTIONAL{?pub le:publisher ?publisher .}
OPTIONAL{?pub le:report ?report .}
OPTIONAL{?pub le:citeKey ?citeKey .}
OPTIONAL{?pub le:edition ?edition .}
OPTIONAL{?pub le:institution ?institution .}
}"""
result, df = L.query(query)
I was also looking for what to query by doing this:
g = L.graph
pub_property=[]
for subj, pred, obj in g:
if 'publication' in subj.lower():
pub_property.append(pred)
from collections import Counter
Counter(pub_property)
And not authors...
Should be fixed in https://github.com/LinkedEarth/pylipd/commit/978714089e670112fe0a142e48224ee20c9560b8 https://github.com/LinkedEarth/pylipd/commit/8971a21d0c62f9f766d0df358581f58c3f3f1565
Note: This will not work for GraphDB, as the triples in GraphDB are missing the author fields due to this bug. That will have to be repopulated. Edit: Fixed for GraphDB (Repopulated Data)
The publication class is missing an author property