-
Notifications
You must be signed in to change notification settings - Fork 0
/
RunExampleotpk.obda
124 lines (104 loc) · 5.93 KB
/
RunExampleotpk.obda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
[PrefixDeclaration]
: https://example.com#
gufo: http://purl.org/nemo/gufo#
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs: http://www.w3.org/2000/01/rdf-schema#
owl: http://www.w3.org/2002/07/owl#
xsd: http://www.w3.org/2001/XMLSchema#
[MappingDeclaration] @collection [[
mappingId RunExample-NamedEntity
target :RunExample/person/{person_id} a :NamedEntity ; :name {name}^^xsd:string .
source SELECT person.person_id, person.name
FROM person
mappingId RunExample-NamedEntity40
target :RunExample/organization/{organization_id} a :NamedEntity ; :name {name}^^xsd:string .
source SELECT organization.organization_id, organization.name
FROM organization
mappingId RunExample-Person
target :RunExample/person/{person_id} a :Person ; :birthDate {birth_date}^^xsd:dateTime .
source SELECT person.person_id, person.birth_date
FROM person
mappingId RunExample-Organization
target :RunExample/organization/{organization_id} a :Organization ; :address {address}^^xsd:string .
source SELECT organization.organization_id, organization.address
FROM organization
mappingId RunExample-BrazilianCitizen
target :RunExample/person/{person_id} a :BrazilianCitizen ; :RG {rg}^^xsd:string .
source SELECT person.person_id, person.rg
FROM person
INNER JOIN nationality
ON person.person_id = nationality.person_id
AND nationality.nationality_enum = 'BRAZILIANCITIZEN'
mappingId RunExample-ItalianCitizen
target :RunExample/person/{person_id} a :ItalianCitizen ; :CI {ci}^^xsd:string .
source SELECT person.person_id, person.ci
FROM person
INNER JOIN nationality
ON person.person_id = nationality.person_id
AND nationality.nationality_enum = 'ITALIANCITIZEN'
mappingId RunExample-Child
target :RunExample/person/{person_id} a :Child .
source SELECT person.person_id
FROM person
WHERE life_phase_enum = 'CHILD'
mappingId RunExample-Adult
target :RunExample/person/{person_id} a :Adult .
source SELECT person.person_id
FROM person
WHERE life_phase_enum = 'ADULT'
mappingId RunExample-PersonalCustomer
target :RunExample/person/{person_id} a :PersonalCustomer ; :creditCard {credit_card}^^xsd:string .
source SELECT person.person_id, person.credit_card
FROM person
WHERE is_personal_customer = TRUE
AND life_phase_enum = 'ADULT'
mappingId RunExample-CorporateCustomer
target :RunExample/organization/{organization_id} a :CorporateCustomer ; :creditLimit {credit_limit}^^xsd:decimal .
source SELECT organization.organization_id, organization.credit_limit
FROM organization
WHERE is_corporate_customer = TRUE
mappingId RunExample-Employee
target :RunExample/person/{person_id} a :Employee .
source SELECT person.person_id
FROM person
WHERE is_employee = TRUE
AND life_phase_enum = 'ADULT'
mappingId RunExample-Employment
target :RunExample/employment/{employment_id} a :Employment ; :salary {salary}^^xsd:decimal ; :hasOrganization :RunExample/organization/{organization_id} ; :hasEmployee :RunExample/person/{person_id} .
source SELECT employment.employment_id, employment.salary, employment.organization_id, employment.person_id
FROM employment
mappingId RunExample-Customer
target :RunExample/organization/{organization_id} a :Customer ; :creditRating {credit_rating}^^xsd:decimal .
source SELECT organization.organization_id, organization.credit_rating
FROM organization
WHERE is_corporate_customer = TRUE
mappingId RunExample-Customer41
target :RunExample/person/{person_id} a :Customer ; :creditRating {credit_rating}^^xsd:decimal .
source SELECT person.person_id, person.credit_rating
FROM person
WHERE is_personal_customer = TRUE
AND life_phase_enum = 'ADULT'
mappingId RunExample-SupplyContract
target :RunExample/supply_contract/{supply_contract_id} a :SupplyContract ; :contractValue {contract_value}^^xsd:decimal ; :hasCustomer :RunExample/organization/{organization_customer_id} ; :hasCustomer :RunExample/person/{person_id} ; :hasContractor :RunExample/organization/{organization_id} .
source SELECT supply_contract.supply_contract_id, supply_contract.contract_value, supply_contract.organization_customer_id, supply_contract.person_id, supply_contract.organization_id
FROM supply_contract
mappingId RunExample-PrimarySchool
target :RunExample/organization/{organization_id} a :PrimarySchool ; :playgroundSize {playground_size}^^xsd:int .
source SELECT organization.organization_id, organization.playground_size
FROM organization
WHERE organization_type_enum = 'PRIMARYSCHOOL'
mappingId RunExample-Hospital
target :RunExample/organization/{organization_id} a :Hospital ; :capacity {capacity}^^xsd:int .
source SELECT organization.organization_id, organization.capacity
FROM organization
WHERE organization_type_enum = 'HOSPITAL'
mappingId RunExample-Enrollment
target :RunExample/enrollment/{enrollment_id} a :Enrollment ; :grade {grade}^^xsd:int ; :hasChild :RunExample/person/{person_id} ; :hasPrimarySchool :RunExample/organization/{organization_id} .
source SELECT enrollment.enrollment_id, enrollment.grade, enrollment.person_id, enrollment.organization_id
FROM enrollment
mappingId RunExample-Contractor
target :RunExample/organization/{organization_id} a :Contractor .
source SELECT organization.organization_id
FROM organization
WHERE is_contractor = TRUE
]]