The flowchart below will help clarify the process used in this example.
The translation of the query result set into RDF proceeds along the following steps:
- Gather the data items of interest and reject any malformed records that can’t reasonably be dealt with. During this step we will populate an intermediate XML called ED0.xml with our selections and try to assign URIs to the people and organizations that we encounter. The unresolved people and organizations are those we cannot match to an existing foaf:Person or a foaf:Organization so the corresponding URI elements are left blank.
- Count the unresolved people (URP) and unresolved organizations (URO).
- Make up a URI for each URP and one for each URO. This must be done in such a way that will guarantee uniqueness in your VIVO instance. In this example, these URIs will be provided. These files are called EX-URP-UNOs.xml and EX-URO-UNOs.xml respectively.
- Generate XML files in the same form of Per0.xml and Org0.xml using the URPs and UROs found in ED0.xml. These files are needed to fill in the missing URIs. We call these NewPers.xml and NewOrgs.xml respectively.
- Fill in the missing organization URIs by transforming ED0.xml into ED1.xml using NewOrgs.xml as a source of organizations to match against. Next transform ED1.xml into ED2.xml filling in the URPs. If either count is 0 then one or both of these transforms is unnecessary.
- For each source row create the RDF for an instance of type vivo:EducationalTraining according to the Education Model shown in Figure 2. This will be straightforward since all unresolved issues are now resolved. In this step we create the file ED.rdf.
- Create any needed RDF for NewPers.xml and NewOrgs.xml and put it in NewPers.rdf and NewOrgs.rdf respectively.
- Declare the local ontology predicates local:degreeLevel and local:weakAttribution and then apply all the new RDF to VIVO.
Next we will elaborate each of these steps and describe key sections of each XSLT.