eyeling 1.12.11 → 1.12.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ==========================
|
|
2
|
+
# Quoted head unquote select
|
|
3
|
+
# ==========================
|
|
4
|
+
#
|
|
5
|
+
# Activate a quoted rule via metadata selection (class → rule → formula),
|
|
6
|
+
# then unquote it by using a term RHS (=> ?F). This should derive :test :is true.
|
|
7
|
+
|
|
8
|
+
@prefix : <http://example.org/ns#> .
|
|
9
|
+
|
|
10
|
+
# Two rules stored as data
|
|
11
|
+
:ruleCat :formula {
|
|
12
|
+
{ ?X a :Cat } => { ?X a :Animal } .
|
|
13
|
+
} .
|
|
14
|
+
|
|
15
|
+
:ruleDog :formula {
|
|
16
|
+
{ ?X a :Dog } => { ?X a :Pet } .
|
|
17
|
+
} .
|
|
18
|
+
|
|
19
|
+
# Metadata chooses which stored rule applies for a given class
|
|
20
|
+
:Cat :activates :ruleCat .
|
|
21
|
+
:Dog :activates :ruleDog .
|
|
22
|
+
|
|
23
|
+
# Different pattern: pick the rule based on the instance's class, then unquote it
|
|
24
|
+
{
|
|
25
|
+
?X a ?Class .
|
|
26
|
+
?Class :activates ?Rule .
|
|
27
|
+
?Rule :formula ?F .
|
|
28
|
+
}
|
|
29
|
+
=> ?F .
|
|
30
|
+
|
|
31
|
+
# Data
|
|
32
|
+
:c a :Cat .
|
|
33
|
+
|
|
34
|
+
# Check
|
|
35
|
+
{ :c a :Animal } => { :test :is true } .
|
|
36
|
+
|