I am quite new in using XSLT.
I am writing an XSL transformation from an XML (metadata) document into an XML/RDF, and I am also improving the model underlying the original document. In specific, the original document describes a Person, and at some point it lists all of the person's names:
<PersonNames>
<PersonName>
<Surname>Doe</Surname>
<FirstName>John</FirstName>
</PersonName>
<PersonName>
<Surname>Doe</Surname>
<FirstName>Janine</FirstName>
</PersonName>
<PersonName>
<Surname>Smith</Surname>
<FirstName>Janine</FirstName>
</PersonName>
</PersonNames>
I don't want to connect the person's URI to each of these items separately, as by doing so it is unclear that 'Joe Smith' has never been a name of this person. I'd rather use a blank node for each name, and then link FirstName and Surname to the corresponding blank node; however, I cannot find a solution to generate a blank node's ID (which I would do inside the xsl:for-each loop that goes through all the person's names) that I can then call outside the loop and refer to.
Intuitively, I would create an id personNameID for each of these element, and then, outside the loop (and outside the subtree), I would add the corresponding triples
<rdf:Description rdf:nodeID="{$personNameID}">
<localontology:firstName 'firstName in $personNameID'>
<localontology:surname 'Surname in $personNameID'>
</rdf:Description>
I really don't know which functions/constructs I could use... is there someone who can help?
No comments:
Post a Comment