Changeset 3801 for CMDI-Interoperability


Ignore:
Timestamp:
10/18/13 11:39:14 (11 years ago)
Author:
mwindhouwer
Message:

M xsl/CMDRecord2RDF.xsl
M xsl/Component2RDF.xsl

  • added intermediate Attribute node
Location:
CMDI-Interoperability/CMD2RDF/trunk/xsl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CMDI-Interoperability/CMD2RDF/trunk/xsl/CMDRecord2RDF.xsl

    r3799 r3801  
    170170        <!-- find the matching instances -->
    171171        <xsl:for-each select="$instance/@*[local-name()=$name]">
    172             <xsl:element name="{$has}Value" namespace="{$ns}">
    173                 <!-- map the CMD XSD datatype to a datatype supported by RDF -->
    174                 <xsl:attribute name="rdf:datatype" select="concat('&xsd;',cmd:datatype($profile/Type))"/>
    175                 <!-- copy the literal -->
    176                 <xsl:value-of select="."/>
    177             </xsl:element>
    178             <xsl:if test="exists($profile/ValueScheme/enumeration)">
    179                 <xsl:element name="{$has}Entity" namespace="{$ns}">
    180                     <xsl:attribute name="rdf:resource" select="concat($ns,$id,'ValueScheme',$STEP,replace(.,'\s',''))"/>
     172            <cmdm:contains>
     173                <xsl:element name="{$id}" namespace="{$ns}">
     174                    <xsl:attribute name="rdf:about" select="concat('#',generate-id(.))"/>
     175                    <xsl:element name="{$has}Value" namespace="{$ns}">
     176                        <!-- map the CMD XSD datatype to a datatype supported by RDF -->
     177                        <xsl:attribute name="rdf:datatype" select="concat('&xsd;',cmd:datatype($profile/Type))"/>
     178                        <!-- copy the literal -->
     179                        <xsl:value-of select="."/>
     180                    </xsl:element>
     181                    <xsl:if test="exists($profile/ValueScheme/enumeration)">
     182                        <xsl:element name="{$has}Entity" namespace="{$ns}">
     183                            <xsl:attribute name="rdf:resource" select="concat($ns,$id,'ValueScheme',$STEP,replace(.,'\s',''))"/>
     184                        </xsl:element>
     185                    </xsl:if>
    181186                </xsl:element>
    182             </xsl:if>
     187            </cmdm:contains>
    183188        </xsl:for-each>
    184189    </xsl:template>
  • CMDI-Interoperability/CMD2RDF/trunk/xsl/Component2RDF.xsl

    r3799 r3801  
    146146        <xsl:variable name="id" select="concat(cmd:path($context,Name),'Attribute')"/>
    147147        <xsl:variable name="has" select="concat(cmd:path($context,concat('has',Name)),'Attribute')"/>
     148        <!-- element becomes a class to be able to group attributes and value together -->
     149        <rdfs:Class rdf:about="{$id}">
     150            <rdfs:subClassOf rdf:resource="&cmdm;Attribute"/>
     151            <xsl:call-template name="generic"/>
     152        </rdfs:Class>
    148153        <!-- an attribute becomes a property -->
    149154        <rdf:Property rdf:about="{$has}Value">
    150155            <rdfs:subPropertyOf rdf:resource="&cmdm;hasAttributeValue"/>
    151             <xsl:call-template name="generic"/>
    152156            <!-- the domain is the CMD element RDF class -->
    153             <rdfs:domain rdf:resource="{$context}"/>
     157            <rdfs:domain rdf:resource="{$id}"/>
    154158            <xsl:choose>
    155159                <!-- if the value scheme is an enumeration the range is the labels -->
     
    172176                <rdfs:subPropertyOf rdf:resource="&cmdm;hasAttributeEntity"/>
    173177                <!-- the domain is the CMD element RDF class -->
    174                 <rdfs:domain rdf:resource="{$context}"/>
     178                <rdfs:domain rdf:resource="{id}"/>
    175179                <!-- the range consists of a superclass for the specific value classes -->
    176180                <rdfs:range rdf:resource="{$id}Value"/>
Note: See TracChangeset for help on using the changeset viewer.