OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

legalruleml message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (LEGALRULEML-12) XSLT for Phase 1+2 conversion from LegalRuleML to RDF


     [ https://issues.oasis-open.org/browse/LEGALRULEML-12?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tara Athan updated LEGALRULEML-12:
----------------------------------

    Proposal: 
A draft XSLT (triplifyCollection.xsl) has been committed. The results of the XSLT when applied to the  validated LegalRuleML instantances in examples/test_triples (normalized serialization) have also been committed, in examples/triplesCollection, and validated as RDF/XML . 

The triplifyCollection XSLT copies the triply XSLT and adds some templates, with higher priority, to implement the exceptional handling of collections.

The implementation uses the user-defined function feature of XSLT 2.0 (xsl:function) to  create a function that checks if an XML node is a collection edge. In particular, the function returns true if all of the following are true:
    1. it is an element
    2. it is a single node, not a node set
    3. local name starts with 'has'
    4. is in the same namespace as its parent
    5. the suffix of its name (after 'has') matches the local name of the parent
       either exactly or as the singular to the parent plural ('y' -> 'ies').
This function is used to implement the following templates
1.  change @keyref on empty collection edge to rdf:Resource with rdf:about
     (instead of the default template for @keyref on an edge that renames it to rdf:resource)
2. wrap the first member of a collection in an rdf:first property
    and pull the other members of the collection into an rdf:rest property
3. wrap the other elements of the collection in a parseType="Collection" edge, or reference rdf:Nil if there is only one member of the collection

  was:
A draft XSLT (triplifyCollection.xsl) has been committed. The results of the XSLT when applied to the  validated LegalRuleML instantances in examples/test_triples (normalized serialization) have also been committed, in examples/triplesCollection, and validated as RDF/XML . 

The triplifyCollection XSLT copies the triply XSLT and adds some templates, with higher priority, to implement the exceptional handling of collections.

The implementation uses the user-defined function feature of XSLT 2.0 (xsl:function) to  create a function that checks if an XML node is a collection edge. In particular, the function returns true if all of the following are true:
    1. it is an element
    2. it is a single node, not a node set
    3. local name starts with 'has'
    4. is in the same namespace as its parent
    5. the suffix of its name (after 'has') matches the local name of the parent
       either exactly or as the singular to the parent plural ('y' -> 'ies').
This function is used to implement the following templates
1.  change @keyref on empty collection edge to rdf:Resource with rdf:about
     (instead of the default template for @keyref on an edge that renames it to rdf:resource)
2. wrap the first element of a collection in an rdf:first property
    and pull the other elements of the collection into an rdf:rest property
3. wrap the other elements of a collection 


> XSLT for Phase 1+2 conversion from LegalRuleML to RDF
> -----------------------------------------------------
>
>                 Key: LEGALRULEML-12
>                 URL: https://issues.oasis-open.org/browse/LEGALRULEML-12
>             Project: OASIS LegalRuleML TC
>          Issue Type: Improvement
>          Components: XSLT for conversion to RDF
>            Reporter: Tara Athan
>            Assignee: Tara Athan
>
>      This stylesheet generates valid RDF/XML if the input meets the preconditions.
>      There is no loss or ambiguity of information except:
>      1. Attributes other than @index on edge elements with child or text content will be ignored. This is the desired behavior- ideally, the normalization transformation will not generate such attributes.
>      2. The case of a Node element having a keyref attribute as well as other attributes or content is worked-around by transforming this to a "derivedFrom" child. In the case when properties are not functional, this is acceptable, but in case where properties are functional, this can lead to inconsistency. For example, a ruleml:content property for ruleml:Time is functional. If we keyreference another ruleml:Time and also have a ruleml:content child, then this should be interpreted as asserting the explicit ruleml:content property *instead of* the ruleml:content property of the original ruleml:Time. Therefore the consequences of a ruleml:derivedFrom property may be non-monotonic, and these consequences must be either determined in a third phase of the XSLT and incorporated into the final RDF output, or the assertion must be treated as an XML Literal.
> Input Preconditions
>   1. All CURIES have been processed into absolute IRIs
>      (e.g. using xslt as in https://apache.googlesource.com/stanbol/+/9b61625545e2ba6b903ea0752dcd20656bada822/enhancer/engines/xmpextractor/src/main/resources/xslt/rdfa.xslt)
>   2. The document is in the normalized form (e.g. after applying an XSLT normalizer.) including:
>       a. Collections may not be empty unless they have a keyref attribute.  



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]