Given a raw URI for a VIVO person RDF page, call get.vivo.person
to get basic attributes regarding the person.
Code
Panel |
---|
No Format |
get.vivo.person<-function(raw.uri){ #Given a # # Given a raw.uri (without the rdf filetype) of a VIVO person page, return basic facts aboutthethe the # the person. Dereference as needed. Missing attributes are returned as NA. # uri # uri <- make.vivo.uri(raw.uri) x x <- xmlParse(uri) name.path <- paste("//rdf:Description[@rdf:about='",raw.uri,"']/rdfs:label",sep="",collapse="") |
...
Panel |
---|
xns<-getNodeSet(x,name.path) |
...
name <- xmlValue(xns[[1 |
...
Panel |
---|
]]) era.commons.id <- get.vivo.attribute(x,"eraCommonsID","http://vivo.ufl.edu/ontology/vivo-ufl/") email <- get.vivo.attribute(x,"email") phone.number <- get.vivo.attribute(x,"phoneNumber") |
...
pubs <- length(getNodeSet(x,"//d:authorInAuthorship",c(d="http://vivoweb.org/ontology/core#"))) |
...
Panel |
---|
grants grants <- length(getNodeSet(x,"//d:hasPrincipalInvestigatorRole",c(d="http://vivoweb.org/ontology/core#"))) #deref first # # deref first (!) personInPosition to get department name # # xns<-getNodeSet(x,"//d:personInPosition",c(d="http://vivoweb.org/ontology/core#")) pip.uri <- make.vivo.uri(xmlGetAttr(xns[[1]],"rdf:resource")) xpip<-xmlParse(pip.uri) xns<-getNodeSet(xpip,"//d:positionInOrganization",c(d="http://vivoweb.org/ontology/core#")) |
...
Panel |
---|
pio.uri <- make.vivo.uri(xmlGetAttr(xns[[1]],"rdf:resource")) xpio xpio <- xmlParse(pio.uri) |
...
department <- get.vivo.name(xpio) |
...
Panel | |
---|---|
list(name=name,pubs=pubs,grants=grants,department=department, era.commons.id=era.commons.id,email=email,phone.number=phone.number) } No Format | |
Sample Run
...
No Format |
---|
> person.raw [1] "http://vivo.ufl.edu/individual/n25562" > get.vivo.person(person.raw) $name 1 $name [1] "Conlon, Mike" |
$pubs
Panel |
---|
1 77 |
$grants
Panel |
---|
1 1 |
$department
Panel |
---|
1 "Health Outcomes and Policy" |
$pubs [1] 77 $grants [1] 1 $department [1] "Health Outcomes and Policy" $era.commons.id |
...
Panel |
---|
1 [1] "MCONLON" |
Panel |
---|
1 $email [1] "mconlon@ufl.edu" $phone.number |
...
Panel |
---|
1 [1] "3522738872" |
|
Notes
- pubs is a count of AuthorInAuthorship assertions on the person page
- grants is a count of hasPrincipalInvestigatorRole on the person page
- department name is doubly dereferenced from personInPosition and then positionInOrganization
- era.commons.id is a UF extension