xsl-list
[Top] [All Lists]

[xsl] Change xml:lang of a skos:prefLabel [ skos, rdf, xml:lang ]

2009-10-14 16:25:48
aloha!

please excuse me for only realizing now (in the year 2009)
how much i could need xsl in connection with rdf.

in my project i'm dealing with skos thesauri (like this one 
http://isegserv.itd.rl.ac.uk/skos/apais/apais200404.rdf (599kb).
the problem is, that the application i'm working on requires
an xml:lang attribute for labels like skos:altLabel or skos:prefLabel.
currently i'm importing such a thesaurus to my triple store, sparql
for every label that has no such xml:lang attribute, delete it, add
an xml:lang attribute with a default language and add it again (there's
no such way to update something like this in a triple store, and i can't
do anything about that).

since this approach is very timeconsuming here's my question :

is there a way (for a complete xsl newbie) to add such an xml:lang
attribute to labels that don't have one and leave the rest of
the thesaurus as it is with xsl?

example : 
i want to get from here :

  <skos:Concept rdf:nodeID="R0386">
    <skos:altLabel>Economic recession</skos:altLabel>
    <skos:altLabel>Depression, Economic</skos:altLabel>
    <skos:related rdf:nodeID="R0392" />
    <skos:related rdf:nodeID="R0174" />
    <skos:inScheme rdf:nodeID="apais" />
    <skos:related rdf:nodeID="R1419" />
    <skos:altLabel>Recession, Economic</skos:altLabel>
    <skos:prefLabel>Economic depression</skos:prefLabel>
    <skos:subjectIndicator 
rdf:resource="http://www.nla.gov.au/apais/thesaurus/html/R0386.html"; />
  </skos:Concept>

to here (with language "en"):

  <skos:Concept rdf:nodeID="R0386">
    <skos:altLabel xml:lang="en">Economic recession</skos:altLabel>
    <skos:altLabel xml:lang="en">Depression, Economic</skos:altLabel>
    <skos:related rdf:nodeID="R0392" />
    <skos:related rdf:nodeID="R0174" />
    <skos:inScheme rdf:nodeID="apais" />
    <skos:related rdf:nodeID="R1419" />
    <skos:altLabel xml:lang="en">Recession, Economic</skos:altLabel>
    <skos:prefLabel xml:lang="en">Economic depression</skos:prefLabel>
    <skos:subjectIndicator 
rdf:resource="http://www.nla.gov.au/apais/thesaurus/html/R0386.html"; />
  </skos:Concept>


any help and pointer where i could start my investigation 
greatly appreciated

wkr www.turnguard.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--