-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add slotdep module and datalogPSOA test suite
- Loading branch information
Showing
5 changed files
with
319 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,223 @@ | ||
namespace dc = "http://purl.org/dc/elements/1.1/" | ||
namespace dcterms = "http://purl.org/dc/terms/" | ||
default namespace ruleml = "http://ruleml.org/spec" | ||
|
||
dcterms:title [ "Deliberation RuleML Custom-Built Schema" ] | ||
dcterms:identifier [ "http://deliberation.ruleml.org/1.03/relaxng/schema_rnc.php?backbone=x7&default=x7&termseq=x7&lng=x1&propo=x3cf&implies=x7&terms=xf0f&quant=x7&expr=x0&serial=x4c" ] | ||
dcterms:isPartOf [ "http://deliberation.ruleml.org/1.03/spec" ] | ||
dcterms:creator [ "http://wiki.ruleml.org/index.php/User:Athant" ] | ||
dc:subject [ "Deliberation RuleML, custom-built" ] | ||
dcterms:description [ | ||
"custom-built main module for a Deliberation RuleML language." | ||
] | ||
dcterms:date [ "2018-07-12T18:31:36+00:00" ] | ||
dcterms:language [ "en" ] | ||
dc:rights [ 'Copyright 2015 RuleML Inc. -- Licensed under the RuleML Specification License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://ruleml.org/licensing/RSL1.0-RuleML. Disclaimer: THIS SPECIFICATION IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, ..., EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. See the License for the specifics governing permissions and limitations under the License.' ] | ||
dcterms:rights [ "http://ruleml.org/licensing/RSL1.0-RuleML" ] | ||
|
||
dcterms:relation [ "http://deliberation.ruleml.org/1.03" ] | ||
# Base URL = http://deliberation.ruleml.org/1.03/relaxng/schema_rnc.php | ||
# Complete URL = | ||
# http://deliberation.ruleml.org/1.03/relaxng/schema_rnc.php?backbone=x7&default=x7&termseq=x7&lng=x1&propo=x3cf&implies=x7&terms=xf0f&quant=x7&expr=x0&serial=x4c | ||
start = Node.choice | edge.choice | ||
# | ||
# ROOT NODE AND PERFORMATIVES INCLUDED | ||
# | ||
include "modules/performative_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
include "modules/performative_content_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# ATOMIC FORMULAS INCLUDED | ||
# | ||
include "modules/atom_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# CONJUNCTIONS AND DISJUNCTIONS INCLUDED | ||
# | ||
include "modules/andor_query_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# IMPLICATIONS INCLUDED | ||
# | ||
include "modules/implication_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# QUANTIFICATION OVER VARIABLES INCLUDED | ||
# | ||
include "modules/quantification_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# ATTRIBUTES WITH DEFAULT VALUES ARE INITIALIZED | ||
# | ||
include "modules/default_inf_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# ATTRIBUTES WITH DEFAULT VALUES ARE ABSENT OR OPTIONAL | ||
# | ||
include "modules/default_absent_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
include "modules/default_absent_folog_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# ATTRIBUTES WITH DEFAULT VALUES REQUIRED | ||
# | ||
include "modules/default_present_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# POLYADIC TERM (ONE OR MORE TERMS) SEQUENCES INCLUDED | ||
# | ||
include "modules/termseq_poly_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# ORDER MODE - UNORDERED GROUPS DISABLED | ||
# | ||
include "modules/ordered_groups_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# EXPLICIT DATATYPING ENABLED | ||
# | ||
include "modules/explicit_datatyping_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
include "modules/explicit_datatyping_value_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
include "modules/explicit_datatyping_annotation_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
include "modules/dataterm_simple_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
include "modules/data_simple_content_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# xsi:schemaLocation ALLOWED IN RuleML | ||
# | ||
include "modules/xsi_schemalocation_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# WEB REFERENCES INCLUDED | ||
# | ||
include "modules/web_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# INTERNATIONALIZED RESOURCE IDENTIFIERS (IRIs) INCLUDED | ||
# | ||
include "modules/iri_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# RULEBASES INCLUDED | ||
# | ||
include "modules/rulebase_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# ENTAILMENTS (PROVES) INCLUDED | ||
# | ||
include "modules/metalevel_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# DEGREE OF UNCERTAINTY INCLUDED | ||
# | ||
include "modules/fuzzy_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# NODE IDENTIFIERS INCLUDED | ||
# | ||
include "modules/node_attribute_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# IN-PLACE ANNOTATIONS INCLUDED | ||
# | ||
include "modules/meta_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# XML BASE ATTRIBUTE INCLUDED | ||
# | ||
include "modules/xml_base_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# XML ID ATTRIBUTE INCLUDED | ||
# | ||
include "modules/xml_id_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# EQUIVALENCES INCLUDED | ||
# | ||
include "modules/equivalent_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# INFERENCE DIRECTION ATTRIBUTE IS INCLUDED | ||
# | ||
include "modules/direction_attrib_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
include "modules/mapdirection_attrib_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# NON-DEFAULT VALUES OF INFERENCE DIRECTION INCLUDED | ||
# | ||
include "modules/direction_non-default_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# DEFAULT VALUES OF INFERENCE DIRECTION INCLUDED | ||
# | ||
include "modules/direction_default_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# MATERIAL IMPLICATION ATTRIBUTE IS INCLUDED | ||
# | ||
include "modules/material_attrib_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
include "modules/mapmaterial_attrib_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# NON-DEFAULT VALUES OF MATERIAL IMPLICATION INCLUDED | ||
# | ||
include "modules/material_non-default_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# DEFAULT VALUES OF MATERIAL IMPLICATION INCLUDED | ||
# | ||
include "modules/material_default_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# OBJECT IDENTIFIERS INCLUDED | ||
# | ||
include "modules/oid_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# SLOTS INCLUDED | ||
# | ||
include "modules/slot_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# DEPENDENT SLOTS INCLUDED | ||
# | ||
include "modules/slotdep_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# SLOT CARDINALITY INCLUDED | ||
# | ||
include "modules/card_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# SLOT WEIGHTS INCLUDED | ||
# | ||
include "modules/weight_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# EXPLICIT TYPING OF TERMS INCLUDED | ||
# | ||
include "modules/type_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# DATA TERMS INCLUDED | ||
# | ||
include "modules/dataterm_any_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# DATA ELEMENTS INCLUDED | ||
# | ||
include "modules/data_any_content_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# SKOLEM CONSTANTS INCLUDED | ||
# | ||
include "modules/skolem_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# REIFICATION TERMS INCLUDED, EXPLICIT CONTENT | ||
# | ||
include "modules/reify_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# INDIVIDUAL TERMS (INTERPRETED NAMES) ARE INCLUDED | ||
# | ||
include "modules/individual_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# VARIABLES (INTERPRETABLE NAMES) ARE INCLUDED | ||
# | ||
include "modules/variable_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# IMPLICIT CLOSURE INCLUDED | ||
# | ||
include "modules/closure_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
include "modules/mapclosure_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# SLOTTED REST VARIABLES INCLUDED | ||
# | ||
include "modules/resl_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# POSITIONAL REST VARIABLES INCLUDED | ||
# | ||
include "modules/repo_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# INITIALIZATION MODULES INCLUDED | ||
# | ||
include "modules/init_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# KEY/KEYREF ATTRIBUTES ENABLED | ||
# | ||
include "modules/key_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
# | ||
# STYLE ATTRIBUTE ENABLED | ||
# | ||
include "modules/attribute_expansion_module.rnc" inherit = ruleml {start |= notAllowed} | ||
|
||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include "../modules/slotdep_expansion_module.rnc" | ||
include "../modules/init_expansion_module.rnc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
namespace dc = "http://purl.org/dc/elements/1.1/" | ||
namespace dcterms = "http://purl.org/dc/terms/" | ||
|
||
dcterms:title [ "RuleML Dependent Slots" ] | ||
dcterms:identifier [ "http://deliberation.ruleml.org/1.03/relaxng/modules/slotdep_expansion_module.rnc" ] | ||
dcterms:isPartOf [ "http://deliberation.ruleml.org/1.03/spec" ] | ||
dcterms:creator [ "http://wiki.ruleml.org/index.php/User:Athant" ] | ||
dc:subject [ "RuleML, dependent slot" ] | ||
dcterms:description [ "The expansion module for dependent slots." ] | ||
dcterms:language [ "en" ] | ||
dc:rights [ | ||
'Copyright 2015 RuleML Inc. -- Licensed under the RuleML Specification License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://ruleml.org/licensing/RSL1.0-RuleML. Disclaimer: THIS SPECIFICATION IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, ..., EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. See the License for the specifics governing permissions and limitations under the License.' | ||
] | ||
dcterms:rights [ "http://ruleml.org/licensing/RSL1.0-RuleML" ] | ||
dcterms:relation [ "http://deliberation.ruleml.org" ] | ||
start |= slotdep.edge.def | ||
# This module declares the following RuleML elements and attributes: | ||
# * slotdep | ||
|
||
## In atomic formulas, zero or more dependent slots are allowed. | ||
slotdepTermsForAtoms.sequence |= slotdep-edge.choice* | ||
|
||
## In expressions, zero or more dependent slots are allowed. | ||
slotdepTermsForExpressions.sequence |= slotdep-edge.choice* | ||
|
||
## an extension point for specializations of the slotdep tag name. | ||
slotdep-edge.choice |= slotdep.edge.def | ||
slotdep.edge.def = | ||
|
||
## A user-defined slotdep (property). See http://deliberation.ruleml.org/1.03/glossary/#gloss-slotdep | ||
element slotdep { slotdep.type.def } | ||
slotdep.type.def = (slotdep-datt.choice & reslotdep.attlist), slotdep.content | ||
|
||
## The slotdep element accepts optional cardinality and weight attributes. | ||
reslotdep.attlist &= cardinality-att.choice? | ||
reslotdep.attlist &= weight-att.choice? | ||
|
||
## The slotdep content model consists of a key (first position) and a filler (second position). | ||
slotdep.content |= slotdepKeyTerm.choice, slotdepFillerTerm.choice | ||
|
||
## The key (first position) in a slotdep contains an interpreted term or data, which may be simple or compound. | ||
slotdepKeyTerm.choice |= SimpleKeyTerm.choice | CompoundTerm.choice | ||
# For the declaration of term patterns, see the term module (individual_expansion_module). | ||
|
||
## The filler (second position) in a slotdep contains any single term. | ||
slotdepFillerTerm.choice |= AnyTerm.choice | ||
# For the declaration of term patterns, see the term module (individual_expansion_module). | ||
edge.choice |= slotdep.edge.def | ||
# | ||
reslotdep.attlist &= commonInit.attlist? |
43 changes: 43 additions & 0 deletions
43
test/rnc-test-suites/datalogPSOA-test-suite/datalogPSOA.ruleml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xml-model href="../../../relaxng/datalogPSOA_normal.rnc"?> | ||
<RuleML xmlns="http://ruleml.org/spec" xmlns:this="http://example.org/datalogPSOA.ruleml" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
|
||
<!-- note the addition of the XML Schema namespace because a built-in datatype is used --> | ||
|
||
<!-- a syntactic example rulebase for testing the Datalog PSOA RuleML sublanguage --> | ||
<act index="1"> | ||
<Assert mapClosure="universal"> | ||
|
||
<formula> | ||
<Implies node="this:#rule1"> | ||
<if> | ||
<Atom> | ||
<oid> | ||
<Ind>John</Ind> | ||
</oid> | ||
<op> | ||
<Rel>TA</Rel> | ||
</op> | ||
<slotdep> | ||
<Ind>workload</Ind> | ||
<Ind>high</Ind> | ||
</slotdep> | ||
</Atom> | ||
</if> | ||
<then> | ||
<Atom> | ||
<op> | ||
<Rel>friend</Rel> | ||
</op> | ||
<slotdep> | ||
<Ind>time</Ind> | ||
<Data xsi:type="xs:dateTime">2001-10-26T21:32:52+02:00</Data> | ||
</slotdep> | ||
</Atom> | ||
</then> | ||
</Implies> | ||
</formula> | ||
</Assert> | ||
</act> | ||
</RuleML> |
90c7c5b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RuleML/issues-ruleml#78