SlideShare una empresa de Scribd logo
1 de 31
Descargar para leer sin conexión
Syntax Reuse: XSLT as a Metalanguage for
  Knowledge Representation Languages

                   Tara Athan
     Athan Services, West Lafayette, IN, USA
            taraathan AT gmail.com
           presented at RuleML 2012
                August 29, 2012
               Montpellier, France
Situation: Information Overload
●   Information           ●   Information Diversity
    Abundance                 ●   Characteristics
    ●   Datasets, Texts           –   Numerical
    ●   Metadata                  –   Textual
    ●   Knowledge Bases           –   Hierarchical
                              ●   Uses
                                  –   Quantitative Processing
                                  –   Search
                                  –   Reasoning
Response: Representation Format
           Overload
●   Geographical Data                  ●   Knowledge
    Formats                                Representation
      –   Flat: Shapefiles, Tabular        Formats
          Data                               –   RDF (XML, N3, Turtle)
      –   Structured Exchange                –   OWL (RDF/XML,
          Formats                                OWL/XML, Manchester)
               XML: GPX, ArcGIS XML,             RuleML (XML, POSL)
           ●
                                             –
               KML, GeoRSS, GML2,
               GML3                          –   Common Logic (CLIF,
           ●   SQL: GDF                          CGIF)
           ●   JSON: GeoJSON                 –   F-Logic
      –   Geodatabases
Semantic Interoperability:
        Translation or Coexistence (I)
●   Between disparate KR languages
    ●   Translation: RDF to OWL, KIF to CLIF, ...
         –   Issues: Incompatibility, redundancy, inefficiency, lossy
    ●   Coexistence
         –   OntoIOp's DOL aims to allow heterogeneous knowledge bases
             to interoperate without translation
●   Between disparate data formats
    ●   Translation for computation, optimized in domain-
        specific applications such as GIS
    ●   Coexistence for visualization (mashups, mapping)
Semantic Interoperability:
        Translation or Coexistence (II)
●   Between data and KR
    ●   Translation:
         –   GML3 transforms shapefiles, databases, ...
              ●   Has conceptual models, not model-theoretic, not grounded in ontology
              ●   Not in general invertible
    ●   Coexistence
         –   RDF, RuleML, CLIF allow embedded structured data
              ●   XMLLiteral, <Data xsi:type="xs:any">, '...'
              ●   IRI with XPath or XPointer provides fine access, but can't quantify
●   Need: Metalanguage for Quantification within
    Embedded Data
Metalanguage Strategy:
              Semantic or Syntactic
●   Semantic                           ●   Syntactic
    ●   RDF Graph                          ●   XPath Data Model (XDM)
        –   Is a set of RDF triples            –   Is also a graph
        –   Model-theoretic                    –   Each node of the graph
            semantics                              has an information set
        –   (Limited) inferences may               (infoset)
            be drawn                           –   No interpretations
    ●   RuleML OrdLab Tree                     –   No inferences
        –   Herbrand Semantics             ●   XSLT uses XDM
XSLT: W3C Recommendation
●   Turing-complete language
    ●   Takes well-formed XML input
    ●   Produces arbitrary character string output
●   Expressed in XML
    ●   May be validated by
        –   Relax NG (https://github.com/ndw/xslt-relax-ng)
        –   XSD (http://www.w3.org/2007/schema-for-xslt20.xsd)
●   Processed by
    ●   Libxslt, Apache Xalan, Saxon XSLT, ...
Metalanguage MXSL Goals
●   Enable reasoning over large, structured legacy
    datasets (e.g. in XML or flat files) without large-
    scale conversion of compact representations into
    the more verbose RuleML format;
●   Allow user-specified deductive systems for
    reasoning over RuleML knowledge bases via
    axiom schemas;
●   Enhance the RuleML query capability.
MXSL Approach
●   Use XSLT to represent the transformation of a set
    of parameter bindings into the corresponding
    instances of that axiom schema
●   Interpret the case when a set of bindings is not
    specified as an axiom schema
    ●   Syntactically indicated by processing instruction

        <?xml-stylesheet type="text/xsl" href="kb2.mxsl"?>
        -->
        <?mxsl type="text/xsl"?>
Example: Captured String Syntax
Inspired from IKL: (= ('a') a)

<ruleml:Equal>
  <ruleml:Expr>
    <ruleml:Fun iri="#constant"/>
    <ruleml:Data xsi:type="xs:string"
       >stringParam</ruleml:Data>
  </ruleml:Expr>
  <ruleml:Ind>stringParam</ruleml:Ind>
</ruleml:Equal>
XSLT Element Construction
<ruleml:Equal>
 <ruleml:Expr>
  <ruleml:Fun iri="#constant"/>
  <ruleml:Data xsi:type="xs:string"
        >stringParam</ruleml:Data>
 </ruleml:Expr>
 <xsl:element name="Ind"
      namespace="http://ruleml.org/spec">
  <xsl:copy-of select="'stringParam'"/>
 </xsl:element>
</ruleml:Equal>
XSLT for-each:
           MXSL Quantification
<xsl:for-each select="$input/v:first/m:binding">
  <xsl:variable name="stringParam"
    select="v:stringParam" xsi:type="xs:string"/>
...
    <xsl:element name="Ind"
     namespace="http://ruleml.org/spec">
     <xsl:copy-of select="$stringParam/node()"/>
    </xsl:element>
...
Two-Phase Interpretation
1. the application of a metainterpretation to
transform the metalanguage instance to another
instance that is purely in the base language;
2. the application of the base language’s model-
theoretic interpretation to transform the derived
instance to truth values.
Truth-Valuation (I)
●   Assume an interpretation I, with vocabulary V and
    metalanguage formula F.
●   Each metainterpretation transformation
    ●   uses one binding of the metalanguage parameters to
        literals, constrained only by datatype
    ●   produces a “preformula”
●   Preformulas are “discarded” that either
    ●   Are not syntactically valid RuleML
    ●   Contain names that are not in vocabulary V
Truth-Valuation (II)
●   Call the remaining set of RuleML formulas S
●   The metalanguage formula F is “valid in an
    interpretation I” if all RuleML formulas in S are
    valid in the interpretation I.
●   In (exactly) that case, I is a “model of F”.
Metalanguage Requirements (I)
●   add element node to output tree, given local
    name and namespace as parameters;
●   add attribute node to element node, given local
    name, name-space and value as parameters;
●   add text node as child of element;
●   iteratively add, in specified order, a number of
    nodes to output tree, based on set of parameter
    bindings represented in structured XML;
Metalanguage Requirements (II)
●   express the hierarchical and sequential structure
    of the output tree isomorphically according to the
    corresponding structure of the metalanguage
    instance.
●   In addition, we have the following operational
    requirements: Instances in metalanguage must:
    ●   validate against the XSLT schema,
    ●   be self-contained,
    ●   be self-executing.
MXSL Syntax (I)
●   <xsl:for-each>, for iteration
●   <xsl:element>, for construction of XML elements
●   <xsl:attribute>, for addition of attributes to XML
    elements
●   <xsl:copy-of> with @select, for generation of the
    values of attributes and contents of element
MXSL Syntax (II)
●   <xsl:stylesheet> (once as the root element)
●   <xsl:variable> (once as a header to define the
    parameter bindings and also as the first children
    of <xsl:for-each>, once for each parameter in the
    iteration)
●   <xsl:template match="/"> (once for the MXSL
    body)
●   <xsl:processing-instruction> (zero to many times
    as the first children of <xsl:template> )
MXSL Syntax (III)
●   <ruleml:RuleML> (once as the last child of
    <xsl:template> to define the root for the output
    document)
●   <xsl:comment> (arbitrarily within the
    <ruleml:RuleML> element)
Example: Structured Data
        Axiom Before Generalization
<r:Rulebase>                                <r:Atom xml:base="&exb">
  <r:Equivalent>                              <r:oid>
    <r:Atom>                                    <r:Ind iri="#b14507?oid"/>
      <r:Rel iri=                             </r:oid>
       "&exv;#data-record-business?rel"/>     <r:Rel
      <r:Data>                                  iri="&exv;#atom-record-business?rel"/>
        <ex:record id="14507"                 <r:slot>
             xml:base=                          <r:Ind iri="#name?key"/>
                 "&exb;">                       <r:Data xsi:type="xs:string">Tara
          <ex:name>Tara Athan</ex:name>     Athan</r:Data>
          <ex:name>Athan                      </r:slot>
            Services</ex:name>                <r:slot>
        </ex:record>                            <r:Ind iri="#business-name?key"/>
      </r:Data>                                 <r:Data xsi:type="xs:string">Athan
    </r:Atom>                                          Services</r:Data>
                                              </r:slot>
                                            </r:Atom></r:Equivalent></r:Rulebase>
Example: Structured Data (cont.)
         MXSL Axiom Schema
<r:Rulebase>                                             <r:Atom>
  <for-each select="$input/ex:business/m:binding">         <attribute name="base" namespace="&xml;">
    <variable name="oid" select="ex:oid"                     <copy-of select="$base/node()"/>
      xsi:type="xs:string"/>                               </attribute>
    <variable name="base" select="ex:base"                 <r:oid>
      xsi:type="xs:anyURI"/>                                 <r:Ind>
    <variable name="name" select="ex:name"                     <attribute name="iri" namespace="">
      xsi:type="xs:string"/>                                     <copy-of select="'#b'"/>
    <variable name="bname" select="ex:bname"                     <copy-of select="$oid/node()"/>
      xsi:type="xs:string"/>                                     <copy-of select="'?oid'"/>
    <r:Equivalent>                                             </attribute>
      <r:Atom>                                               </r:Ind>
        <r:Rel iri="&exv;#data-record-business?rel"/>      </r:oid>
        <r:Data>                                           <r:Rel iri="&exv;#atom-record-business?rel"/>
          <ex:record>                                      <r:slot>
             <attribute name="id" namespace="">              <r:Ind iri="#name?key"/>
               <copy-of select="$oid/node()"/>               <r:Data xsi:type="xs:string">
             </attribute>                                      <copy-of select="$name/node()"/>
             <attribute name="base" namespace="&xml;">       </r:Data>
               <copy-of select="$base/node()"/>            </r:slot>
             </attribute>                                  <r:slot>
             <element name="name"                            <r:Ind iri="#business-name?key"/>
               namespace="&mxsl;/example/vocab">             <r:Data xsi:type="xs:string">
               <copy-of select="$name/node()"/>                <copy-of select="$bname/node()"/>
             </element>                                      </r:Data>
             <element name="name"                          </r:slot>
               namespace="&mxsl;/example/vocab">         </r:Atom></r:Equivalent></for-each></r:Rulebase>
               <copy-of select="$bname/node()"/>
             </element>
          </ex:record>
        </r:Data>
      </r:Atom>
Overview of Infinitary Logic (I)
●   Given a base (finitary) language L
●
    Parameter κ : cardinality of sequences of
    conjunctions and disjunctions, also cardinality of
    set of variable symbols
                  ∧ j∈ J Φ j                ∨ j∈ J Φ j        ∣J∣<κ
●
    Parameter λ : cardinality of sequences of
    quantifiers (λ <= κ)

          ●   http://plato.stanford.edu/entries/logic-infinitary/
Overview of Infinitary Logic (II)
●
    L(ω, ω) = L
●   L(ω1, ω) = countable sequences of “junctions”
    ●   If L is FOL, L(ω1, ω) is complete* but not compact**                 [Skolem, 1920]




●   L(ω1, ω1) = countable sequences of quantifiers
    ●   If L is FOL, L(ω1, ω1) is neither complete nor compact
                *
            ●    Completeness is defined with respect to a deductive system that
                allows proofs of countable length, and assumes countable sets of
                axioms
                **
            ●    Compact means if every finite subset of a set of formulas has a
                model then the original set has a model
RuleML with MXSL Axiom
                  Schemas
●
    Assert/Rulebase/xsl:for-each –> L(ω, ω) –>
    complete, compact
●   Assert/Rulebase/{And, Or}/xsl:for-each
    ●   Disallowing mapClosure on Assert or Rulebase, nor
        closure on And –> L(ω1, ω) -> complete, not compact*
    ●   Allowing mapClosure on Assert or Rulebase, or closure
        on And –> L(ω1, ω1) -> neither complete nor compact*

        *Follows if RuleML is given FOL semantics, assumes
        countable literals
Infinitary Case: In practice
●   Nonliteral vocabulary is typically finite
●   Literals can be introduced only as needed
●   Consider the captured string axiom
    ●   One binding needed for each nonliteral in vocabulary
    ●   (= ('a') a) is discarded by the semantics if "a" is not in the
        vocabulary
●   So finite model property can be retained even
    with MXSL axiom schemas
Extensions: xsl:for-each/Query
<xsl:for-each ...>
 <Query>
  <Atom><Rel>P</Rel>
    <Ind>
       <xsl:attribute name="type">
        <xsl:copy-of select="$typeval/node()"/>
   ●   Interpret as implicit disjunction of multiple queries
   ●   Success = inconsistency of rulebase appended with
       negations of query (Rulebase/xsl:for-each/Neg) - L(ω, ω)
   ●   Bindings are lost – extended query capability is needed
Metalanguage Abstract Syntax
●   Grouping symbols entered as pairs through one
    command
●   Mirrors the structure of the output document.
●   Iteration command generates a set of sibling
    items based on a pattern, instantiated with
    parameters.
●   Text always added through a metalanguage
    command, implementing output-escaping of
    punctuation characters
MXSL: For CLIF
<xsl:for-each select="$input/v:first/m:binding">
  <xsl:variable name="stringParam" select="v:stringParam"
    xsi:type="xs:string"/>
  <xsl:call-template name="element-cl">
    <xsl:with-param name="apply" select="'='"/>
    <xsl:with-param name="args">
      <xsl:call-template name="element-cl">
        <xsl:with-param name="apply">
          <xsl:call-template name="element-squote">
          <xsl:with-param name="arg"
               select="$stringParam/node()"/>
          </xsl:call-template>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="element-dquote">
        <xsl:with-param name="arg"
             select="$stringParam/node()"/>
      </xsl:call-template>
    </xsl:with-param>
  </xsl:call-template>
</xsl:for-each>
MCLIF
(mcltext captured-string-axiom
  (for-each
    (($stringParam xs:string))
    ( =
      (apply (squote $stringParam))
      (dquote $stringParam )
) ) )
Conclusions
●   MXSL: a (small) subset of the XSLT language,
    which can be used as a syntactic metalanguage
    for XML-based KR languages
●   MXSL expresses
    ●   axiom schemas
    ●   semantics of structured data
    ●   generalized queries.
●   Paradigm for non-XML-based formats
●   Future investigations: reasoning

Más contenido relacionado

La actualidad más candente

An Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of DataAn Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of DataOlaf Hartig
 
Apache spark on planet scale
Apache spark on planet scaleApache spark on planet scale
Apache spark on planet scaleDenis Chapligin
 
RDF Validation Future work and applications
RDF Validation Future work and applicationsRDF Validation Future work and applications
RDF Validation Future work and applicationsJose Emilio Labra Gayo
 
State of the Semantic Web
State of the Semantic WebState of the Semantic Web
State of the Semantic WebIvan Herman
 
Translation of Relational and Non-Relational Databases into RDF with xR2RML
Translation of Relational and Non-Relational Databases into RDF with xR2RMLTranslation of Relational and Non-Relational Databases into RDF with xR2RML
Translation of Relational and Non-Relational Databases into RDF with xR2RMLFranck Michel
 
RDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesRDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesMarin Dimitrov
 
SPARQL in the Semantic Web
SPARQL in the Semantic WebSPARQL in the Semantic Web
SPARQL in the Semantic WebJan Beeck
 
Shape Expressions: An RDF validation and transformation language
Shape Expressions: An RDF validation and transformation languageShape Expressions: An RDF validation and transformation language
Shape Expressions: An RDF validation and transformation languageJose Emilio Labra Gayo
 
Mapping Relational Databases to Linked Data
Mapping Relational Databases to Linked DataMapping Relational Databases to Linked Data
Mapping Relational Databases to Linked DataEUCLID project
 
ANSI SQL Transparent Multipath Hierarchical Structured Data Processing for Re...
ANSI SQL Transparent Multipath Hierarchical Structured Data Processing for Re...ANSI SQL Transparent Multipath Hierarchical Structured Data Processing for Re...
ANSI SQL Transparent Multipath Hierarchical Structured Data Processing for Re...Michael M David
 
Ks2008 Semanticweb In Action
Ks2008 Semanticweb In ActionKs2008 Semanticweb In Action
Ks2008 Semanticweb In ActionRinke Hoekstra
 
Wherecamp Navigation Conference 2015 - SPOI SDI4pps: Points of Interest
Wherecamp Navigation Conference 2015 - SPOI SDI4pps: Points of InterestWherecamp Navigation Conference 2015 - SPOI SDI4pps: Points of Interest
Wherecamp Navigation Conference 2015 - SPOI SDI4pps: Points of InterestWhereCampBerlin
 
Bio it 2005_rdf_workshop05
Bio it 2005_rdf_workshop05Bio it 2005_rdf_workshop05
Bio it 2005_rdf_workshop05Joanne Luciano
 

La actualidad más candente (19)

SWT Lecture Session 8 - Rules
SWT Lecture Session 8 - RulesSWT Lecture Session 8 - Rules
SWT Lecture Session 8 - Rules
 
Hibernate
HibernateHibernate
Hibernate
 
RDF briefing
RDF briefingRDF briefing
RDF briefing
 
An Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of DataAn Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of Data
 
Apache spark on planet scale
Apache spark on planet scaleApache spark on planet scale
Apache spark on planet scale
 
RDF Validation Future work and applications
RDF Validation Future work and applicationsRDF Validation Future work and applications
RDF Validation Future work and applications
 
Triple Stores
Triple StoresTriple Stores
Triple Stores
 
OWLED'12 Quest
OWLED'12 QuestOWLED'12 Quest
OWLED'12 Quest
 
State of the Semantic Web
State of the Semantic WebState of the Semantic Web
State of the Semantic Web
 
PO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - SqlPO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - Sql
 
Translation of Relational and Non-Relational Databases into RDF with xR2RML
Translation of Relational and Non-Relational Databases into RDF with xR2RMLTranslation of Relational and Non-Relational Databases into RDF with xR2RML
Translation of Relational and Non-Relational Databases into RDF with xR2RML
 
RDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesRDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic Repositories
 
SPARQL in the Semantic Web
SPARQL in the Semantic WebSPARQL in the Semantic Web
SPARQL in the Semantic Web
 
Shape Expressions: An RDF validation and transformation language
Shape Expressions: An RDF validation and transformation languageShape Expressions: An RDF validation and transformation language
Shape Expressions: An RDF validation and transformation language
 
Mapping Relational Databases to Linked Data
Mapping Relational Databases to Linked DataMapping Relational Databases to Linked Data
Mapping Relational Databases to Linked Data
 
ANSI SQL Transparent Multipath Hierarchical Structured Data Processing for Re...
ANSI SQL Transparent Multipath Hierarchical Structured Data Processing for Re...ANSI SQL Transparent Multipath Hierarchical Structured Data Processing for Re...
ANSI SQL Transparent Multipath Hierarchical Structured Data Processing for Re...
 
Ks2008 Semanticweb In Action
Ks2008 Semanticweb In ActionKs2008 Semanticweb In Action
Ks2008 Semanticweb In Action
 
Wherecamp Navigation Conference 2015 - SPOI SDI4pps: Points of Interest
Wherecamp Navigation Conference 2015 - SPOI SDI4pps: Points of InterestWherecamp Navigation Conference 2015 - SPOI SDI4pps: Points of Interest
Wherecamp Navigation Conference 2015 - SPOI SDI4pps: Points of Interest
 
Bio it 2005_rdf_workshop05
Bio it 2005_rdf_workshop05Bio it 2005_rdf_workshop05
Bio it 2005_rdf_workshop05
 

Destacado

Importation Closure that is Robust to Circular Dependencies
Importation Closure that is Robust to Circular DependenciesImportation Closure that is Robust to Circular Dependencies
Importation Closure that is Robust to Circular DependenciesTara Athan
 
Demo of MYNG 1.01
Demo of MYNG 1.01Demo of MYNG 1.01
Demo of MYNG 1.01Tara Athan
 
LegalRuleML Metamodel
LegalRuleML MetamodelLegalRuleML Metamodel
LegalRuleML MetamodelTara Athan
 
Genome and Proteome data integration in RDF
Genome and Proteome data integration in RDFGenome and Proteome data integration in RDF
Genome and Proteome data integration in RDFNadia Anwar
 
English language unit 1
English language unit 1English language unit 1
English language unit 1mrpanaccio
 
Recent biotechnology innovations
Recent biotechnology innovationsRecent biotechnology innovations
Recent biotechnology innovationsMuhammed sadiq
 
Qualitative Methods in Applied Linguistics
Qualitative Methods in Applied LinguisticsQualitative Methods in Applied Linguistics
Qualitative Methods in Applied LinguisticsKhoshnaw Rahmani
 
Drug development & biotechnology
Drug development & biotechnologyDrug development & biotechnology
Drug development & biotechnologyTeresa Treasures
 
Comprehensible output hypothesis
Comprehensible output hypothesisComprehensible output hypothesis
Comprehensible output hypothesisRoger Flores
 
Revision Booklet for GCSE English Unit 1 Exam
Revision Booklet for GCSE English Unit 1 ExamRevision Booklet for GCSE English Unit 1 Exam
Revision Booklet for GCSE English Unit 1 Examwhslaura
 
Intake and output class of year one student final 2
Intake and output class of year one student final 2Intake and output class of year one student final 2
Intake and output class of year one student final 2aku karachi
 
Intake & output measurement
Intake & output measurementIntake & output measurement
Intake & output measurementchrissie argana
 
Biotech & medicine.ppt
Biotech & medicine.pptBiotech & medicine.ppt
Biotech & medicine.pptMahin Nwx
 
Input vs output hypothesis
Input vs output hypothesisInput vs output hypothesis
Input vs output hypothesischiamb
 

Destacado (14)

Importation Closure that is Robust to Circular Dependencies
Importation Closure that is Robust to Circular DependenciesImportation Closure that is Robust to Circular Dependencies
Importation Closure that is Robust to Circular Dependencies
 
Demo of MYNG 1.01
Demo of MYNG 1.01Demo of MYNG 1.01
Demo of MYNG 1.01
 
LegalRuleML Metamodel
LegalRuleML MetamodelLegalRuleML Metamodel
LegalRuleML Metamodel
 
Genome and Proteome data integration in RDF
Genome and Proteome data integration in RDFGenome and Proteome data integration in RDF
Genome and Proteome data integration in RDF
 
English language unit 1
English language unit 1English language unit 1
English language unit 1
 
Recent biotechnology innovations
Recent biotechnology innovationsRecent biotechnology innovations
Recent biotechnology innovations
 
Qualitative Methods in Applied Linguistics
Qualitative Methods in Applied LinguisticsQualitative Methods in Applied Linguistics
Qualitative Methods in Applied Linguistics
 
Drug development & biotechnology
Drug development & biotechnologyDrug development & biotechnology
Drug development & biotechnology
 
Comprehensible output hypothesis
Comprehensible output hypothesisComprehensible output hypothesis
Comprehensible output hypothesis
 
Revision Booklet for GCSE English Unit 1 Exam
Revision Booklet for GCSE English Unit 1 ExamRevision Booklet for GCSE English Unit 1 Exam
Revision Booklet for GCSE English Unit 1 Exam
 
Intake and output class of year one student final 2
Intake and output class of year one student final 2Intake and output class of year one student final 2
Intake and output class of year one student final 2
 
Intake & output measurement
Intake & output measurementIntake & output measurement
Intake & output measurement
 
Biotech & medicine.ppt
Biotech & medicine.pptBiotech & medicine.ppt
Biotech & medicine.ppt
 
Input vs output hypothesis
Input vs output hypothesisInput vs output hypothesis
Input vs output hypothesis
 

Similar a Syntax Reuse: XSLT as a Metalanguage for Knowledge Representation Languages

XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...Diego Berrueta
 
XML Tools for Perl
XML Tools for PerlXML Tools for Perl
XML Tools for PerlGeir Aalberg
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2Dimitris Kontokostas
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)Serhii Kartashov
 
advDBMS_XML.pptx
advDBMS_XML.pptxadvDBMS_XML.pptx
advDBMS_XML.pptxIreneGetzi
 
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).pptDATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).pptcareerPointBasti
 
OCAS @ ISWC 2011 - Generic Multilevel Approach Designing Domain Ontologies Ba...
OCAS @ ISWC 2011 - Generic Multilevel Approach Designing Domain Ontologies Ba...OCAS @ ISWC 2011 - Generic Multilevel Approach Designing Domain Ontologies Ba...
OCAS @ ISWC 2011 - Generic Multilevel Approach Designing Domain Ontologies Ba...Dr.-Ing. Thomas Hartmann
 
The Lumber Mill - XSLT For Your Templates
The Lumber Mill  - XSLT For Your TemplatesThe Lumber Mill  - XSLT For Your Templates
The Lumber Mill - XSLT For Your TemplatesThomas Weinert
 
No SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in RubyNo SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in Rubysbeam
 
unit_5_XML data integration database management
unit_5_XML data integration database managementunit_5_XML data integration database management
unit_5_XML data integration database managementsathiyabcsbs
 
Java Course 12: XML & XSL, Web & Servlets
Java Course 12: XML & XSL, Web & ServletsJava Course 12: XML & XSL, Web & Servlets
Java Course 12: XML & XSL, Web & ServletsAnton Keks
 
Infromation Reprentation, Structured Data and Semantics
Infromation Reprentation,Structured Data and SemanticsInfromation Reprentation,Structured Data and Semantics
Infromation Reprentation, Structured Data and SemanticsYogendra Tamang
 
SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Languageelliando dias
 
XML Schema Patterns for Databinding
XML Schema Patterns for DatabindingXML Schema Patterns for Databinding
XML Schema Patterns for DatabindingPaul Downey
 
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...Dr.-Ing. Thomas Hartmann
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1Marco Gralike
 
Semantic RDF based integration framework for heterogeneous XML data sources
Semantic RDF based integration framework for heterogeneous XML data sourcesSemantic RDF based integration framework for heterogeneous XML data sources
Semantic RDF based integration framework for heterogeneous XML data sourcesDeniz Kılınç
 
The Lumber Mill Xslt For Your Templates
The Lumber Mill   Xslt For Your TemplatesThe Lumber Mill   Xslt For Your Templates
The Lumber Mill Xslt For Your TemplatesThomas Weinert
 
XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7Deniz Kılınç
 

Similar a Syntax Reuse: XSLT as a Metalanguage for Knowledge Representation Languages (20)

XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
 
XML Tools for Perl
XML Tools for PerlXML Tools for Perl
XML Tools for Perl
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
advDBMS_XML.pptx
advDBMS_XML.pptxadvDBMS_XML.pptx
advDBMS_XML.pptx
 
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).pptDATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
 
OCAS @ ISWC 2011 - Generic Multilevel Approach Designing Domain Ontologies Ba...
OCAS @ ISWC 2011 - Generic Multilevel Approach Designing Domain Ontologies Ba...OCAS @ ISWC 2011 - Generic Multilevel Approach Designing Domain Ontologies Ba...
OCAS @ ISWC 2011 - Generic Multilevel Approach Designing Domain Ontologies Ba...
 
The Lumber Mill - XSLT For Your Templates
The Lumber Mill  - XSLT For Your TemplatesThe Lumber Mill  - XSLT For Your Templates
The Lumber Mill - XSLT For Your Templates
 
No SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in RubyNo SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in Ruby
 
unit_5_XML data integration database management
unit_5_XML data integration database managementunit_5_XML data integration database management
unit_5_XML data integration database management
 
Java Course 12: XML & XSL, Web & Servlets
Java Course 12: XML & XSL, Web & ServletsJava Course 12: XML & XSL, Web & Servlets
Java Course 12: XML & XSL, Web & Servlets
 
XML Fundamentals
XML FundamentalsXML Fundamentals
XML Fundamentals
 
Infromation Reprentation, Structured Data and Semantics
Infromation Reprentation,Structured Data and SemanticsInfromation Reprentation,Structured Data and Semantics
Infromation Reprentation, Structured Data and Semantics
 
SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Language
 
XML Schema Patterns for Databinding
XML Schema Patterns for DatabindingXML Schema Patterns for Databinding
XML Schema Patterns for Databinding
 
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
 
Semantic RDF based integration framework for heterogeneous XML data sources
Semantic RDF based integration framework for heterogeneous XML data sourcesSemantic RDF based integration framework for heterogeneous XML data sources
Semantic RDF based integration framework for heterogeneous XML data sources
 
The Lumber Mill Xslt For Your Templates
The Lumber Mill   Xslt For Your TemplatesThe Lumber Mill   Xslt For Your Templates
The Lumber Mill Xslt For Your Templates
 
XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7
 

Syntax Reuse: XSLT as a Metalanguage for Knowledge Representation Languages

  • 1. Syntax Reuse: XSLT as a Metalanguage for Knowledge Representation Languages Tara Athan Athan Services, West Lafayette, IN, USA taraathan AT gmail.com presented at RuleML 2012 August 29, 2012 Montpellier, France
  • 2. Situation: Information Overload ● Information ● Information Diversity Abundance ● Characteristics ● Datasets, Texts – Numerical ● Metadata – Textual ● Knowledge Bases – Hierarchical ● Uses – Quantitative Processing – Search – Reasoning
  • 3. Response: Representation Format Overload ● Geographical Data ● Knowledge Formats Representation – Flat: Shapefiles, Tabular Formats Data – RDF (XML, N3, Turtle) – Structured Exchange – OWL (RDF/XML, Formats OWL/XML, Manchester) XML: GPX, ArcGIS XML, RuleML (XML, POSL) ● – KML, GeoRSS, GML2, GML3 – Common Logic (CLIF, ● SQL: GDF CGIF) ● JSON: GeoJSON – F-Logic – Geodatabases
  • 4. Semantic Interoperability: Translation or Coexistence (I) ● Between disparate KR languages ● Translation: RDF to OWL, KIF to CLIF, ... – Issues: Incompatibility, redundancy, inefficiency, lossy ● Coexistence – OntoIOp's DOL aims to allow heterogeneous knowledge bases to interoperate without translation ● Between disparate data formats ● Translation for computation, optimized in domain- specific applications such as GIS ● Coexistence for visualization (mashups, mapping)
  • 5. Semantic Interoperability: Translation or Coexistence (II) ● Between data and KR ● Translation: – GML3 transforms shapefiles, databases, ... ● Has conceptual models, not model-theoretic, not grounded in ontology ● Not in general invertible ● Coexistence – RDF, RuleML, CLIF allow embedded structured data ● XMLLiteral, <Data xsi:type="xs:any">, '...' ● IRI with XPath or XPointer provides fine access, but can't quantify ● Need: Metalanguage for Quantification within Embedded Data
  • 6. Metalanguage Strategy: Semantic or Syntactic ● Semantic ● Syntactic ● RDF Graph ● XPath Data Model (XDM) – Is a set of RDF triples – Is also a graph – Model-theoretic – Each node of the graph semantics has an information set – (Limited) inferences may (infoset) be drawn – No interpretations ● RuleML OrdLab Tree – No inferences – Herbrand Semantics ● XSLT uses XDM
  • 7. XSLT: W3C Recommendation ● Turing-complete language ● Takes well-formed XML input ● Produces arbitrary character string output ● Expressed in XML ● May be validated by – Relax NG (https://github.com/ndw/xslt-relax-ng) – XSD (http://www.w3.org/2007/schema-for-xslt20.xsd) ● Processed by ● Libxslt, Apache Xalan, Saxon XSLT, ...
  • 8. Metalanguage MXSL Goals ● Enable reasoning over large, structured legacy datasets (e.g. in XML or flat files) without large- scale conversion of compact representations into the more verbose RuleML format; ● Allow user-specified deductive systems for reasoning over RuleML knowledge bases via axiom schemas; ● Enhance the RuleML query capability.
  • 9. MXSL Approach ● Use XSLT to represent the transformation of a set of parameter bindings into the corresponding instances of that axiom schema ● Interpret the case when a set of bindings is not specified as an axiom schema ● Syntactically indicated by processing instruction <?xml-stylesheet type="text/xsl" href="kb2.mxsl"?> --> <?mxsl type="text/xsl"?>
  • 10. Example: Captured String Syntax Inspired from IKL: (= ('a') a) <ruleml:Equal> <ruleml:Expr> <ruleml:Fun iri="#constant"/> <ruleml:Data xsi:type="xs:string" >stringParam</ruleml:Data> </ruleml:Expr> <ruleml:Ind>stringParam</ruleml:Ind> </ruleml:Equal>
  • 11. XSLT Element Construction <ruleml:Equal> <ruleml:Expr> <ruleml:Fun iri="#constant"/> <ruleml:Data xsi:type="xs:string" >stringParam</ruleml:Data> </ruleml:Expr> <xsl:element name="Ind" namespace="http://ruleml.org/spec"> <xsl:copy-of select="'stringParam'"/> </xsl:element> </ruleml:Equal>
  • 12. XSLT for-each: MXSL Quantification <xsl:for-each select="$input/v:first/m:binding"> <xsl:variable name="stringParam" select="v:stringParam" xsi:type="xs:string"/> ... <xsl:element name="Ind" namespace="http://ruleml.org/spec"> <xsl:copy-of select="$stringParam/node()"/> </xsl:element> ...
  • 13. Two-Phase Interpretation 1. the application of a metainterpretation to transform the metalanguage instance to another instance that is purely in the base language; 2. the application of the base language’s model- theoretic interpretation to transform the derived instance to truth values.
  • 14. Truth-Valuation (I) ● Assume an interpretation I, with vocabulary V and metalanguage formula F. ● Each metainterpretation transformation ● uses one binding of the metalanguage parameters to literals, constrained only by datatype ● produces a “preformula” ● Preformulas are “discarded” that either ● Are not syntactically valid RuleML ● Contain names that are not in vocabulary V
  • 15. Truth-Valuation (II) ● Call the remaining set of RuleML formulas S ● The metalanguage formula F is “valid in an interpretation I” if all RuleML formulas in S are valid in the interpretation I. ● In (exactly) that case, I is a “model of F”.
  • 16. Metalanguage Requirements (I) ● add element node to output tree, given local name and namespace as parameters; ● add attribute node to element node, given local name, name-space and value as parameters; ● add text node as child of element; ● iteratively add, in specified order, a number of nodes to output tree, based on set of parameter bindings represented in structured XML;
  • 17. Metalanguage Requirements (II) ● express the hierarchical and sequential structure of the output tree isomorphically according to the corresponding structure of the metalanguage instance. ● In addition, we have the following operational requirements: Instances in metalanguage must: ● validate against the XSLT schema, ● be self-contained, ● be self-executing.
  • 18. MXSL Syntax (I) ● <xsl:for-each>, for iteration ● <xsl:element>, for construction of XML elements ● <xsl:attribute>, for addition of attributes to XML elements ● <xsl:copy-of> with @select, for generation of the values of attributes and contents of element
  • 19. MXSL Syntax (II) ● <xsl:stylesheet> (once as the root element) ● <xsl:variable> (once as a header to define the parameter bindings and also as the first children of <xsl:for-each>, once for each parameter in the iteration) ● <xsl:template match="/"> (once for the MXSL body) ● <xsl:processing-instruction> (zero to many times as the first children of <xsl:template> )
  • 20. MXSL Syntax (III) ● <ruleml:RuleML> (once as the last child of <xsl:template> to define the root for the output document) ● <xsl:comment> (arbitrarily within the <ruleml:RuleML> element)
  • 21. Example: Structured Data Axiom Before Generalization <r:Rulebase> <r:Atom xml:base="&exb"> <r:Equivalent> <r:oid> <r:Atom> <r:Ind iri="#b14507?oid"/> <r:Rel iri= </r:oid> "&exv;#data-record-business?rel"/> <r:Rel <r:Data> iri="&exv;#atom-record-business?rel"/> <ex:record id="14507" <r:slot> xml:base= <r:Ind iri="#name?key"/> "&exb;"> <r:Data xsi:type="xs:string">Tara <ex:name>Tara Athan</ex:name> Athan</r:Data> <ex:name>Athan </r:slot> Services</ex:name> <r:slot> </ex:record> <r:Ind iri="#business-name?key"/> </r:Data> <r:Data xsi:type="xs:string">Athan </r:Atom> Services</r:Data> </r:slot> </r:Atom></r:Equivalent></r:Rulebase>
  • 22. Example: Structured Data (cont.) MXSL Axiom Schema <r:Rulebase> <r:Atom> <for-each select="$input/ex:business/m:binding"> <attribute name="base" namespace="&xml;"> <variable name="oid" select="ex:oid" <copy-of select="$base/node()"/> xsi:type="xs:string"/> </attribute> <variable name="base" select="ex:base" <r:oid> xsi:type="xs:anyURI"/> <r:Ind> <variable name="name" select="ex:name" <attribute name="iri" namespace=""> xsi:type="xs:string"/> <copy-of select="'#b'"/> <variable name="bname" select="ex:bname" <copy-of select="$oid/node()"/> xsi:type="xs:string"/> <copy-of select="'?oid'"/> <r:Equivalent> </attribute> <r:Atom> </r:Ind> <r:Rel iri="&exv;#data-record-business?rel"/> </r:oid> <r:Data> <r:Rel iri="&exv;#atom-record-business?rel"/> <ex:record> <r:slot> <attribute name="id" namespace=""> <r:Ind iri="#name?key"/> <copy-of select="$oid/node()"/> <r:Data xsi:type="xs:string"> </attribute> <copy-of select="$name/node()"/> <attribute name="base" namespace="&xml;"> </r:Data> <copy-of select="$base/node()"/> </r:slot> </attribute> <r:slot> <element name="name" <r:Ind iri="#business-name?key"/> namespace="&mxsl;/example/vocab"> <r:Data xsi:type="xs:string"> <copy-of select="$name/node()"/> <copy-of select="$bname/node()"/> </element> </r:Data> <element name="name" </r:slot> namespace="&mxsl;/example/vocab"> </r:Atom></r:Equivalent></for-each></r:Rulebase> <copy-of select="$bname/node()"/> </element> </ex:record> </r:Data> </r:Atom>
  • 23. Overview of Infinitary Logic (I) ● Given a base (finitary) language L ● Parameter κ : cardinality of sequences of conjunctions and disjunctions, also cardinality of set of variable symbols ∧ j∈ J Φ j ∨ j∈ J Φ j ∣J∣<κ ● Parameter λ : cardinality of sequences of quantifiers (λ <= κ) ● http://plato.stanford.edu/entries/logic-infinitary/
  • 24. Overview of Infinitary Logic (II) ● L(ω, ω) = L ● L(ω1, ω) = countable sequences of “junctions” ● If L is FOL, L(ω1, ω) is complete* but not compact** [Skolem, 1920] ● L(ω1, ω1) = countable sequences of quantifiers ● If L is FOL, L(ω1, ω1) is neither complete nor compact * ● Completeness is defined with respect to a deductive system that allows proofs of countable length, and assumes countable sets of axioms ** ● Compact means if every finite subset of a set of formulas has a model then the original set has a model
  • 25. RuleML with MXSL Axiom Schemas ● Assert/Rulebase/xsl:for-each –> L(ω, ω) –> complete, compact ● Assert/Rulebase/{And, Or}/xsl:for-each ● Disallowing mapClosure on Assert or Rulebase, nor closure on And –> L(ω1, ω) -> complete, not compact* ● Allowing mapClosure on Assert or Rulebase, or closure on And –> L(ω1, ω1) -> neither complete nor compact* *Follows if RuleML is given FOL semantics, assumes countable literals
  • 26. Infinitary Case: In practice ● Nonliteral vocabulary is typically finite ● Literals can be introduced only as needed ● Consider the captured string axiom ● One binding needed for each nonliteral in vocabulary ● (= ('a') a) is discarded by the semantics if "a" is not in the vocabulary ● So finite model property can be retained even with MXSL axiom schemas
  • 27. Extensions: xsl:for-each/Query <xsl:for-each ...> <Query> <Atom><Rel>P</Rel> <Ind> <xsl:attribute name="type"> <xsl:copy-of select="$typeval/node()"/> ● Interpret as implicit disjunction of multiple queries ● Success = inconsistency of rulebase appended with negations of query (Rulebase/xsl:for-each/Neg) - L(ω, ω) ● Bindings are lost – extended query capability is needed
  • 28. Metalanguage Abstract Syntax ● Grouping symbols entered as pairs through one command ● Mirrors the structure of the output document. ● Iteration command generates a set of sibling items based on a pattern, instantiated with parameters. ● Text always added through a metalanguage command, implementing output-escaping of punctuation characters
  • 29. MXSL: For CLIF <xsl:for-each select="$input/v:first/m:binding"> <xsl:variable name="stringParam" select="v:stringParam" xsi:type="xs:string"/> <xsl:call-template name="element-cl"> <xsl:with-param name="apply" select="'='"/> <xsl:with-param name="args"> <xsl:call-template name="element-cl"> <xsl:with-param name="apply"> <xsl:call-template name="element-squote"> <xsl:with-param name="arg" select="$stringParam/node()"/> </xsl:call-template> </xsl:with-param> </xsl:call-template> <xsl:call-template name="element-dquote"> <xsl:with-param name="arg" select="$stringParam/node()"/> </xsl:call-template> </xsl:with-param> </xsl:call-template> </xsl:for-each>
  • 30. MCLIF (mcltext captured-string-axiom (for-each (($stringParam xs:string)) ( = (apply (squote $stringParam)) (dquote $stringParam ) ) ) )
  • 31. Conclusions ● MXSL: a (small) subset of the XSLT language, which can be used as a syntactic metalanguage for XML-based KR languages ● MXSL expresses ● axiom schemas ● semantics of structured data ● generalized queries. ● Paradigm for non-XML-based formats ● Future investigations: reasoning