Given a non-complete uri, the get.vivo.org
function returns popular attributes of the organization as a list. if the attribute value is not specified in VIVO, the resulting value is NA. Sub organizations are returned as a list. The list has zero length if there are no sub organizations. If there are sub organizations, the list contains the non-complete uri for each one.
Code
get.vivo.org<-function(raw.uri){
#
- Given a raw uri, return attributes of the organization at that uri. subOrganizations
- are returned as a list of raw uri.
#
uri <- make.vivo.uri(raw.uri)
x <- xmlParse(uri)
name <- get.vivo.name
type <- get.vivo.type
s <- getNodeSet(x,"//d:hasSubOrganization",c(d="http://vivoweb.org/ontology/core#"))
subs <- sapply(s,function(el) xmlAttrs(el)"resource")
list(name=name,type=type,subs=subs)
}
Sample run
> dentistry.raw<-"http://vivo.ufl.edu/individual/CollegeofDentistry"
> get.vivo.org(dentistry.raw)
$name
1 "College of Dentistry"
$type
1 "College"
$subs
resource
"http://vivo.ufl.edu/individual/Periodontology"
resource
"http://vivo.ufl.edu/individual/Endodontics"
resource
"http://vivo.ufl.edu/individual/Prosthodontics"
resource
"http://vivo.ufl.edu/individual/OralBiology"
resource
"http://vivo.ufl.edu/individual/CommunityDentistryandBehavioralScience"
resource
"http://vivo.ufl.edu/individual/Orthodontics"
resource
"http://vivo.ufl.edu/individual/PediatricDentistry"
resource
"http://vivo.ufl.edu/individual/OperativeDentistry"
resource
"http://vivo.ufl.edu/individual/OralandMaxillofacialDiagnosticSciences"
resource
"http://vivo.ufl.edu/individual/n35294"
resource
"http://vivo.ufl.edu/individual/OralandMaxillofacialSurgery"
>
Notes
- Each entry in the subs list has name "resource" since the uri is found in the RDF resource attribute
- The UF college of Dentistry was used in this example. It has 11 departments