Skip to content

Commit bc44611

Browse files
committed
adding lldm example
1 parent 610524a commit bc44611

File tree

4 files changed

+324
-21
lines changed

4 files changed

+324
-21
lines changed

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
build:
44
cargo build --release
55

6-
socrates: build
7-
target/release/eyelite examples/socrates.n3 > examples/output/socrates.n3
8-
96
backward: build
107
target/release/eyelite examples/backward_demo.n3 > examples/output/backward_demo.n3
118

129
french: build
1310
target/release/eyelite examples/french_cities.n3 > examples/output/french_cities.n3
1411

12+
lldm: build
13+
target/release/eyelite examples/lldm.n3 > examples/output/lldm.n3
14+
1515
peano: build
1616
target/release/eyelite examples/peano.n3 > examples/output/peano.n3
1717

18-
all: socrates backward french peano
18+
socrates: build
19+
target/release/eyelite examples/socrates.n3 > examples/output/socrates.n3
20+
21+
all: backward french lldm peano socrates
1922

2023
clean:
2124
cargo clean

examples/lldm.n3

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
2+
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
3+
@prefix owl: <http://www.w3.org/2002/07/owl#>.
4+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
5+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
6+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
7+
@prefix : <http://www.agfa.com/w3c/2002/10/medicad/op/lldmP#>.
8+
9+
## measurement data
10+
11+
:meas47 a :Measurement;
12+
:p1xCm 10.1; :p1yCm 7.8;
13+
:p2xCm 45.1; :p2yCm 5.6;
14+
:p3xCm 3.6; :p3yCm 29.8;
15+
:p4xCm 54.7; :p4yCm 28.5.
16+
17+
## measurement axioms
18+
19+
:p1 a :Point; :incident :L1.
20+
:p2 a :Point; :incident :L1.
21+
:p3 a :Point; :incident :L3.
22+
:p4 a :Point; :incident :L4.
23+
:p5 a :Point; :incident :L1, :L3.
24+
:p6 a :Point; :incident :L1, :L4.
25+
:L1 a :Line; :perpendicular :L3, :L4.
26+
:L3 a :Line.
27+
:L4 a :Line.
28+
29+
:incident rdfs:domain :Point; rdfs:range :Line; owl:inverseOf :contains.
30+
:perpendicular rdfs:domain :Line; rdfs:range :Line; a owl:SymmetricProperty.
31+
32+
:p1xCm rdfs:domain :Measurement; rdfs:range :Quantity.
33+
:p1yCm rdfs:domain :Measurement; rdfs:range :Quantity.
34+
:p2xCm rdfs:domain :Measurement; rdfs:range :Quantity.
35+
:p2yCm rdfs:domain :Measurement; rdfs:range :Quantity.
36+
:p3xCm rdfs:domain :Measurement; rdfs:range :Quantity.
37+
:p3yCm rdfs:domain :Measurement; rdfs:range :Quantity.
38+
:p4xCm rdfs:domain :Measurement; rdfs:range :Quantity.
39+
:p4yCm rdfs:domain :Measurement; rdfs:range :Quantity.
40+
:p5xCm rdfs:domain :Measurement; rdfs:range :Quantity.
41+
:p5yCm rdfs:domain :Measurement; rdfs:range :Quantity.
42+
:p6xCm rdfs:domain :Measurement; rdfs:range :Quantity.
43+
:p6yCm rdfs:domain :Measurement; rdfs:range :Quantity.
44+
:dx12Cm rdfs:domain :Measurement; rdfs:range :Quantity.
45+
:dx51Cm rdfs:domain :Measurement; rdfs:range :Quantity.
46+
:dx53Cm rdfs:domain :Measurement; rdfs:range :Quantity.
47+
:dx62Cm rdfs:domain :Measurement; rdfs:range :Quantity.
48+
:dx64Cm rdfs:domain :Measurement; rdfs:range :Quantity.
49+
:dy12Cm rdfs:domain :Measurement; rdfs:range :Quantity.
50+
:dy13Cm rdfs:domain :Measurement; rdfs:range :Quantity.
51+
:dy24Cm rdfs:domain :Measurement; rdfs:range :Quantity.
52+
:dy53Cm rdfs:domain :Measurement; rdfs:range :Quantity.
53+
:dy64Cm rdfs:domain :Measurement; rdfs:range :Quantity.
54+
:cL1 rdfs:domain :Measurement; rdfs:range :Quantity.
55+
:dL3m rdfs:domain :Measurement; rdfs:range :Quantity.
56+
:cL3 rdfs:domain :Measurement; rdfs:range :Quantity.
57+
:pL1x1Cm rdfs:domain :Measurement; rdfs:range :Quantity.
58+
:pL1x2Cm rdfs:domain :Measurement; rdfs:range :Quantity.
59+
:pL3x3Cm rdfs:domain :Measurement; rdfs:range :Quantity.
60+
:pL3x4Cm rdfs:domain :Measurement; rdfs:range :Quantity.
61+
:dd13Cm rdfs:domain :Measurement; rdfs:range :Quantity.
62+
:ddy13Cm rdfs:domain :Measurement; rdfs:range :Quantity.
63+
:dd24Cm rdfs:domain :Measurement; rdfs:range :Quantity.
64+
:ddy24Cm rdfs:domain :Measurement; rdfs:range :Quantity.
65+
:ddL13 rdfs:domain :Measurement; rdfs:range :Quantity.
66+
:pL1dx51Cm rdfs:domain :Measurement; rdfs:range :Quantity.
67+
:pL1dx62Cm rdfs:domain :Measurement; rdfs:range :Quantity.
68+
:sdx53Cm2 rdfs:domain :Measurement; rdfs:range :Quantity.
69+
:sdx64Cm2 rdfs:domain :Measurement; rdfs:range :Quantity.
70+
:sdy53Cm2 rdfs:domain :Measurement; rdfs:range :Quantity.
71+
:sdy64Cm2 rdfs:domain :Measurement; rdfs:range :Quantity.
72+
:sdd53Cm2 rdfs:domain :Measurement; rdfs:range :Quantity.
73+
:sdd64Cm2 rdfs:domain :Measurement; rdfs:range :Quantity.
74+
:ssd53Cm2 rdfs:domain :Measurement; rdfs:range :Quantity.
75+
:ssd64Cm2 rdfs:domain :Measurement; rdfs:range :Quantity.
76+
:d53Cm rdfs:domain :Measurement; rdfs:range :Quantity.
77+
:d64Cm rdfs:domain :Measurement; rdfs:range :Quantity.
78+
:dCm rdfs:domain :Measurement; rdfs:range :Quantity.
79+
80+
## measurement implications
81+
82+
{?M a :Measurement; :p1xCm ?X; :p2xCm ?Y. (?X ?Y) math:difference ?Z} => {?M :dx12Cm ?Z}.
83+
{?M a :Measurement; :p5xCm ?X; :p1xCm ?Y. (?X ?Y) math:difference ?Z} => {?M :dx51Cm ?Z}.
84+
{?M a :Measurement; :p5xCm ?X; :p3xCm ?Y. (?X ?Y) math:difference ?Z} => {?M :dx53Cm ?Z}.
85+
{?M a :Measurement; :p6xCm ?X; :p2xCm ?Y. (?X ?Y) math:difference ?Z} => {?M :dx62Cm ?Z}.
86+
{?M a :Measurement; :p6xCm ?X; :p4xCm ?Y. (?X ?Y) math:difference ?Z} => {?M :dx64Cm ?Z}.
87+
{?M a :Measurement; :p1yCm ?X; :p2yCm ?Y. (?X ?Y) math:difference ?Z} => {?M :dy12Cm ?Z}.
88+
{?M a :Measurement; :p1yCm ?X; :p3yCm ?Y. (?X ?Y) math:difference ?Z} => {?M :dy13Cm ?Z}.
89+
{?M a :Measurement; :p2yCm ?X; :p4yCm ?Y. (?X ?Y) math:difference ?Z} => {?M :dy24Cm ?Z}.
90+
{?M a :Measurement; :p5yCm ?X; :p3yCm ?Y. (?X ?Y) math:difference ?Z} => {?M :dy53Cm ?Z}.
91+
{?M a :Measurement; :p6yCm ?X; :p4yCm ?Y. (?X ?Y) math:difference ?Z} => {?M :dy64Cm ?Z}.
92+
93+
{?M a :Measurement; :dy12Cm ?Y; :dx12Cm ?X. (?Y ?X) math:quotient ?Z} => {?M :cL1 ?Z}.
94+
{?M a :Measurement; :cL1 ?X. (1 ?X) math:quotient ?Z} => {?M :dL3m ?Z}.
95+
{?M a :Measurement; :dL3m ?X. (0 ?X) math:difference ?Z} => {?M :cL3 ?Z}.
96+
97+
{?M a :Measurement; :cL1 ?X; :p1xCm ?Y. (?X ?Y) math:product ?Z} => {?M :pL1x1Cm ?Z}.
98+
{?M a :Measurement; :cL1 ?X; :p2xCm ?Y. (?X ?Y) math:product ?Z} => {?M :pL1x2Cm ?Z}.
99+
{?M a :Measurement; :cL3 ?X; :p3xCm ?Y. (?X ?Y) math:product ?Z} => {?M :pL3x3Cm ?Z}.
100+
{?M a :Measurement; :cL3 ?X; :p4xCm ?Y. (?X ?Y) math:product ?Z} => {?M :pL3x4Cm ?Z}.
101+
{?M a :Measurement; :pL1x1Cm ?X; :pL3x3Cm ?Y. (?X ?Y) math:difference ?Z} => {?M :dd13Cm ?Z}.
102+
{?M a :Measurement; :dd13Cm ?X; :dy13Cm ?Y. (?X ?Y) math:difference ?Z} => {?M :ddy13Cm ?Z}.
103+
{?M a :Measurement; :pL1x2Cm ?X; :pL3x4Cm ?Y. (?X ?Y) math:difference ?Z} => {?M :dd24Cm ?Z}.
104+
{?M a :Measurement; :dd24Cm ?X; :dy24Cm ?Y. (?X ?Y) math:difference ?Z} => {?M :ddy24Cm ?Z}.
105+
{?M a :Measurement; :cL1 ?X; :cL3 ?Y. (?X ?Y) math:difference ?Z} => {?M :ddL13 ?Z}.
106+
{?M a :Measurement; :cL1 ?X; :dx51Cm ?Y. (?X ?Y) math:product ?Z} => {?M :pL1dx51Cm ?Z}.
107+
{?M a :Measurement; :cL1 ?X; :dx62Cm ?Y. (?X ?Y) math:product ?Z} => {?M :pL1dx62Cm ?Z}.
108+
109+
{?M a :Measurement; :ddy13Cm ?X; :ddL13 ?Y. (?X ?Y) math:quotient ?Z} => {?M :p5xCm ?Z}.
110+
{?M a :Measurement; :pL1dx51Cm ?X; :p1yCm ?Y. (?X ?Y) math:sum ?Z} => {?M :p5yCm ?Z}.
111+
{?M a :Measurement; :ddy24Cm ?X; :ddL13 ?Y. (?X ?Y) math:quotient ?Z} => {?M :p6xCm ?Z}.
112+
{?M a :Measurement; :pL1dx62Cm ?X; :p2yCm ?Y. (?X ?Y) math:sum ?Z} => {?M :p6yCm ?Z}.
113+
114+
{?M a :Measurement; :dx53Cm ?X. (?X 2) math:exponentiation ?Z} => {?M :sdx53Cm2 ?Z}.
115+
{?M a :Measurement; :dx64Cm ?X. (?X 2) math:exponentiation ?Z} => {?M :sdx64Cm2 ?Z}.
116+
{?M a :Measurement; :dy53Cm ?X. (?X 2) math:exponentiation ?Z} => {?M :sdy53Cm2 ?Z}.
117+
{?M a :Measurement; :dy64Cm ?X. (?X 2) math:exponentiation ?Z} => {?M :sdy64Cm2 ?Z}.
118+
{?M a :Measurement; :sdx53Cm2 ?X; :sdy53Cm2 ?Y. (?X ?Y) math:sum ?Z} => {?M :ssd53Cm2 ?Z}.
119+
{?M a :Measurement; :sdx64Cm2 ?X; :sdy64Cm2 ?Y. (?X ?Y) math:sum ?Z} => {?M :ssd64Cm2 ?Z}.
120+
121+
{?M a :Measurement; :ssd53Cm2 ?X. (?X 0.5) math:exponentiation ?Z} => {?M :d53Cm ?Z}.
122+
{?M a :Measurement; :ssd64Cm2 ?X. (?X 0.5) math:exponentiation ?Z} => {?M :d64Cm ?Z}.
123+
124+
{?M a :Measurement; :d53Cm ?X; :d64Cm ?Y. (?X ?Y) math:difference ?Z} => {?M :dCm ?Z}.
125+
126+
{?M a :Measurement; :dCm ?X. ?X math:lessThan -1.25} => {?M a :LLDAlarm}.
127+
{?M a :Measurement; :dCm ?X. ?X math:greaterThan 1.25} => {?M a :LLDAlarm}.

examples/output/lldm.n3

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
@prefix : <http://www.agfa.com/w3c/2002/10/medicad/op/lldmP#>.
2+
3+
:meas47 :cL1 -0.06285714285714286 .
4+
:meas47 :cL3 15.909090909090908 .
5+
:meas47 :d53Cm 21.548900464617255 .
6+
:meas47 :d64Cm 23.45713444515475 .
7+
:meas47 :dCm -1.9082339805374957 .
8+
:meas47 :dL3m -15.909090909090908 .
9+
:meas47 :dd13Cm -57.90758441558442 .
10+
:meas47 :dd24Cm -873.0621298701299 .
11+
:meas47 :ddL13 -15.97194805194805 .
12+
:meas47 :ddy13Cm -35.90758441558442 .
13+
:meas47 :ddy24Cm -850.1621298701299 .
14+
:meas47 :dx12Cm -35 .
15+
:meas47 :dx51Cm -7.851834384960645 .
16+
:meas47 :dx53Cm -1.351834384960645 .
17+
:meas47 :dx62Cm 8.128455734079232 .
18+
:meas47 :dx64Cm -1.4715442659207696 .
19+
:meas47 :dy12Cm 2.2 .
20+
:meas47 :dy13Cm -22 .
21+
:meas47 :dy24Cm -22.9 .
22+
:meas47 :dy53Cm -21.506456124373905 .
23+
:meas47 :dy64Cm -23.41093150328498 .
24+
:meas47 :p5xCm 2.248165615039355 .
25+
:meas47 :p5yCm 8.293543875626098 .
26+
:meas47 :p6xCm 53.22845573407923 .
27+
:meas47 :p6yCm 5.0890684967150195 .
28+
:meas47 :pL1dx51Cm 0.4935438756260977 .
29+
:meas47 :pL1dx62Cm -0.5109315032849803 .
30+
:meas47 :pL1x1Cm -0.6348571428571429 .
31+
:meas47 :pL1x2Cm -2.834857142857143 .
32+
:meas47 :pL3x3Cm 57.27272727272727 .
33+
:meas47 :pL3x4Cm 870.2272727272727 .
34+
:meas47 :sdx53Cm2 1.8274562043619251 .
35+
:meas47 :sdx64Cm2 2.1654425265642967 .
36+
:meas47 :sdy53Cm2 462.52765502961984 .
37+
:meas47 :sdy64Cm2 548.0717138515012 .
38+
:meas47 :ssd53Cm2 464.35511123398175 .
39+
:meas47 :ssd64Cm2 550.2371563780655 .
40+
:meas47 a :LLDAlarm .

0 commit comments

Comments
 (0)