AgentsΒΆ
Agents are used in the standard name table to attribute authors and related organizations to the table.
import ssnolib
person = ssnolib.Person(firstname="Matthias", lastName="Probst", orcidId="https://orcid.org/0000-0001-8729-0482")
person
Person(id=https://orcid.org/0000-0001-8729-0482, lastName=Probst, orcidId=https://orcid.org/0000-0001-8729-0482, firstname=Matthias)
orga = ssnolib.Organization(name="Awesome university@en", hasRorId="https://ror.org/04t3en479")
orga
Organization(id=https://ror.org/04t3en479, name=Awesome university@en, hasRorId=https://ror.org/04t3en479)
Because the ssnolib.Person was set up in a way, that the orcidId - if given - is used as the ID when exported to JSON-LD:
print(person.model_dump_jsonld())
{
"@context": {
"owl": "http://www.w3.org/2002/07/owl#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"dcterms": "http://purl.org/dc/terms/",
"schema": "https://schema.org/",
"skos": "http://www.w3.org/2004/02/skos/core#",
"prov": "http://www.w3.org/ns/prov#",
"foaf": "http://xmlns.com/foaf/0.1/",
"m4i": "http://w3id.org/nfdi4ing/metadata4ing#"
},
"@type": "prov:Person",
"foaf:lastName": "Probst",
"m4i:orcidId": {
"@id": "https://orcid.org/0000-0001-8729-0482"
},
"firstname": "Matthias",
"@id": "https://orcid.org/0000-0001-8729-0482"
}
The same accounts for hasRorId in organizations:
print(orga.model_dump_jsonld())
{
"@context": {
"owl": "http://www.w3.org/2002/07/owl#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"dcterms": "http://purl.org/dc/terms/",
"schema": "https://schema.org/",
"skos": "http://www.w3.org/2004/02/skos/core#",
"prov": "http://www.w3.org/ns/prov#",
"foaf": "http://xmlns.com/foaf/0.1/",
"m4i": "http://w3id.org/nfdi4ing/metadata4ing#"
},
"@type": "prov:Organization",
"foaf:name": {
"@value": "Awesome university",
"@language": "en"
},
"m4i:hasRorId": {
"@id": "https://ror.org/04t3en479"
},
"@id": "https://ror.org/04t3en479"
}
Alternative, dump the as Turtle:
print(person.model_dump_ttl())
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix m4i: <http://w3id.org/nfdi4ing/metadata4ing#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
<https://orcid.org/0000-0001-8729-0482> a prov:Person ;
m4i:orcidId <https://orcid.org/0000-0001-8729-0482> ;
foaf:lastName "Probst" .
print(orga.model_dump_ttl())
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix m4i: <http://w3id.org/nfdi4ing/metadata4ing#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
<https://ror.org/04t3en479> a prov:Organization ;
m4i:hasRorId <https://ror.org/04t3en479> ;
foaf:name "Awesome university"@en .