Changeset 5234


Ignore:
Timestamp:
05/19/14 15:41:49 (10 years ago)
Author:
xnrn@gmx.net
Message:

added a trivial mechanism to change the prefix in the base/about URI

Location:
CMDI-Interoperability/CMD2RDF/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CMDI-Interoperability/CMD2RDF/trunk/build-dist.props

    r5214 r5234  
    1616# cache.dir=${basedir.cmd2rdf}/cmd-profiles
    1717
     18# the file path (base-uri() is used as xml:base and main subject of the RDF
     19# it should have a nice URI and not some local-file name
     20# thus we want to translate the base-uri:       
     21# part of the base-uri to be replaced (it has to be exactly in the format as the XSLT-transformer sees it)     
     22#base.strip=${in.dir}
     23
     24# prefix to be added instead of the stripped part       
     25#base.add=http://www.clarin.eu/cmd/
     26
    1827# where to write the converted data
    1928#out.dir=data/cmd-rdf
  • CMDI-Interoperability/CMD2RDF/trunk/build.xml

    r5217 r5234  
    2323        <property name="cache.dir" location="${basedir.cmd2rdf}/cmd-profiles" />
    2424       
     25        <property name="base.strip" location="${in.dir}" />
     26        <property name="base.add" value="http://www.clarin.eu/cmd/" />
     27       
    2528        <property name="out.dir" value="data/cmd-rdf" />
    2629        <property name="smc.base" value="../../../SMC/" />
     
    4447               
    4548                <saxon-xslt style="xsl/CMDRecord2RDFcache.xsl"
    46                         basedir="${in.dir}" includes="**/*.xml" destdir="${out.dir}" extension=".rdf"
     49                        basedir="${in.dir}" includes="**/oai_meertens_knaw_nl_http___hdl_handle_net_10744_mi_022000e4_0cc1_4699_849c_4b41a01d4f01.xml" destdir="${out.dir}" extension=".rdf"
    4750                        force="true" >
     51                        <param name="base_strip" expression="${base.strip}"/>
     52                        <param name="base_add" expression="${base.add}"/>
    4853                        <param name="cache_dir" expression="${cache.dir}"/>
    4954<!--                    <param name="cache" expression="refresh"/>-->
  • CMDI-Interoperability/CMD2RDF/trunk/xsl/CMDRecord2RDF.xsl

    r4830 r5234  
    2222    <xsl:output method="xml" encoding="UTF-8"/>
    2323   
    24     <xsl:param name="base" select="base-uri()"/>
     24    <!-- allow to rewrite the urls -->
     25    <xsl:param name="base_strip" select="base-uri()"/>
     26    <xsl:param name="base_add" select="''"/>
     27   
     28    <xsl:variable name="about" select="replace(if ($base_strip=base-uri()) then base-uri() else replace(base-uri(), $base_strip, $base_add),'([./])(xml|cmdi)$','$1rdf')"/>
    2529   
    2630    <xsl:include href="CMD2RDF.xsl"/>
     
    3034    <!-- let's create some RDF -->
    3135    <xsl:template match="/cmd:CMD">
    32         <rdf:RDF xml:base="{replace($base,'([./])(xml|cmdi)$','$1rdf')}">
     36        <rdf:RDF xml:base="{$about}">
    3337            <!-- The CMDI is seen as OA Annotation of a (set of) resource(s) -->
    34             <oa:Annotation rdf:about="{$base}">
     38            <oa:Annotation rdf:about="{$about}">
    3539                <xsl:apply-templates select="cmd:Resources" mode="resources"/>
    3640                <oa:hasBody>
     
    4347            <!-- The CMDI is an ORE ResourceMap to other metadata descriptions -->
    4448            <xsl:if test="exists(cmd:Resources/ResourceProxyList/ResourceProxy[ResourceType='Metadata'])">
    45                 <ore:ResourceMap rdf:about="{$base}">
     49                <ore:ResourceMap rdf:about="{$about}">
    4650                    <ore:describes>
    4751                        <ore:Aggregation>
Note: See TracChangeset for help on using the changeset viewer.