Skip to content

Commit

Permalink
administrative model
Browse files Browse the repository at this point in the history
  • Loading branch information
aguayoe committed Jan 9, 2024
1 parent 3dc0766 commit 8e3696b
Showing 1 changed file with 208 additions and 0 deletions.
208 changes: 208 additions & 0 deletions SemanticModel/YARRRML/administrative.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX prov: <https://www.w3.org/ns/prov#>
PREFIX org: <https://www.w3.org/ns/org#>
PREFIX : <http://my_example.com/>

:#collectionShape IRI {
prov:wasAssociatedWith @:orgIdShape ;
a [sio:SIO_001049] ;
a [prov:activity]
}

:orgIdShape IRI {
sio:SIO_000671 @:#identifierShape ;
sio:SIO_000059 @:#individualShape ;
a [prov:Agent] ;
rdfs:label [string] ;
a [org:Organization] ;
a [sio:SIO_000012]
}

:#individualShape IRI {
sio:SIO_000228 @:#roleShape ;
foaf:name xsd:string ;
a [prov:Agent] ;
a [org:Membership] ;
a [sio:SIO_000498]
}

:#identifierShape IRI {
sio:SIO_000300 xsd:string
}

:#roleShape IRI {
a [org:role] ;
a @:memberRoleShape
}

mapping:
20240109181837716481_source_cde_test:
predicateobject:
- objects:
type: iri
value: $(org_id)
predicate: prov:wasAssociatedWith
- objects:
type: iri
value: sio:SIO_001049
predicate: rdf:type
- objects:
type: iri
value: prov:activity
predicate: rdf:type
sources:
- source_cde_test
subjects: this:$(bgvid)_$(uniqid)#Collection
20240109181837716515_source_cde_test:
predicateobject:
- objects:
type: iri
value: this:$(uniqid)#identifier
predicate: sio:SIO_000671
- objects:
type: iri
value: this:$(uniqid)#individual
predicate: sio:SIO_000059
- objects:
type: iri
value: prov:Agent
predicate: rdf:type
- objects:
datatype: string
value: $(org_name)
predicate: rdfs:label
- objects:
type: iri
value: org:Organization
predicate: rdf:type
- objects:
type: iri
value: sio:SIO_000012
predicate: rdf:type
sources:
- source_cde_test
subjects: $(org_id)
20240109181837716522_source_cde_test:
predicateobject:
- objects:
type: iri
value: this:$(uniqid)#Role
predicate: sio:SIO_000228
- objects:
datatype: xsd:string
value: $(member_name)
predicate: foaf:name
- objects:
type: iri
value: prov:Agent
predicate: rdf:type
- objects:
type: iri
value: org:Membership
predicate: rdf:type
- objects:
type: iri
value: sio:SIO_000498
predicate: rdf:type
sources:
- source_cde_test
subjects: this:$(uniqid)#individual
20240109181837716526_source_cde_test:
predicateobject:
- objects:
datatype: xsd:string
value: $(org_id)
predicate: sio:SIO_000300
sources:
- source_cde_test
subjects: this:$(uniqid)#identifier
20240109181837716533_source_cde_test:
predicateobject:
- objects:
type: iri
value: org:role
predicate: rdf:type
- objects:
type: iri
value: $(member_role)
predicate: rdf:type
sources:
- source_cde_test
subjects: this:$(uniqid)#Role
prefixes:
foaf: http://xmlns.com/foaf/0.1/
org: https://www.w3.org/ns/org#
prov: https://www.w3.org/ns/prov#
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs: http://www.w3.org/2000/01/rdf-schema#
sio: http://semanticscience.org/resource/
this: http://my_example.com/
sources:
source_cde_test:
access: admin_csv.csv
iterator: $
referenceFormulation: csv

[PrefixDeclaration]
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs: http://www.w3.org/2000/01/rdf-schema#
sio: http://semanticscience.org/resource/
foaf: http://xmlns.com/foaf/0.1/
prov: https://www.w3.org/ns/prov#
org: https://www.w3.org/ns/org#
this: http://my_example.com/

[MappingDeclaration] @collection [[
mappingId source_cde_test20240109181837720667
target this:{bgvid}_{uniqid}#Collection prov:wasAssociatedWith <{org_id}> ; a sio:SIO_001049 ; a prov:activity .
source SELECT * FROM mytable #ADD your QUERY HERE

mappingId source_cde_test20240109181837720701
target {org_id} sio:SIO_000671 this:{uniqid}#identifier ; sio:SIO_000059 this:{uniqid}#individual ; a prov:Agent ; rdfs:label "{org_name}"^^string ; a org:Organization ; a sio:SIO_000012 .
source SELECT * FROM mytable #ADD your QUERY HERE

mappingId source_cde_test20240109181837720713
target this:{uniqid}#individual sio:SIO_000228 this:{uniqid}#Role ; foaf:name "{member_name}"^^xsd:string ; a prov:Agent ; a org:Membership ; a sio:SIO_000498 .
source SELECT * FROM mytable #ADD your QUERY HERE

mappingId source_cde_test20240109181837720721
target this:{uniqid}#identifier sio:SIO_000300 "{org_id}"^^xsd:string .
source SELECT * FROM mytable #ADD your QUERY HERE

mappingId source_cde_test20240109181837720726
target this:{uniqid}#Role a org:role ; a <{member_role}> .
source SELECT * FROM mytable #ADD your QUERY HERE

]]

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX prov: <https://www.w3.org/ns/prov#>
PREFIX org: <https://www.w3.org/ns/org#>
PREFIX this: <http://my_example.com/>
SELECT DISTINCT *
WHERE {
?#collection prov:wasAssociatedWith ?orgid .
?orgid sio:SIO_000671 ?#identifier .
?orgid sio:SIO_000059 ?#individual .
?#individual sio:SIO_000228 ?#role .
?#collection a sio:SIO_001049 .
?#collection a prov:activity .
?orgid a prov:Agent .
?orgid rdfs:label string .
?orgid a org:Organization .
?orgid a sio:SIO_000012 .
?#identifier sio:SIO_000300 xsd:string .
?#individual foaf:name xsd:string .
?#individual a prov:Agent .
?#individual a org:Membership .
?#individual a sio:SIO_000498 .
?#role a org:role .
?#role a ?memberrole .
}

0 comments on commit 8e3696b

Please sign in to comment.