diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_create_event.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_create_event.n3 new file mode 100644 index 000000000..3a38d01e9 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_create_event.n3 @@ -0,0 +1,210 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix creation_properties: . +@prefix unpacking_properties: . +@prefix execute_template: . +@prefix creation_parameter: . +@prefix whitelist_access: . +@prefix event_condition: . +@prefix dynapi_model: . + +############################################### +### CREATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Create an event"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:hasFirstStep creation_properties:step1 ; + dynapi:providesParameter creation_parameter:uri . + +creation_properties:step1 + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 1"@en-US ; + dynapi:hasOperation execute_template:n3_template_subject ; + dynapi:hasNextStep creation_properties:conditional_for_step2 . + +creation_properties:conditional_for_step2 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event type check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step2 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step3 ; + dynapi:hasCondition event_condition:type_check . + +creation_properties:step2 + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 2"@en-US ; + dynapi:hasOperation execute_template:n3_template_type ; + dynapi:hasNextStep creation_properties:conditional_for_step3 . + +creation_properties:conditional_for_step3 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step3 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step4 ; + dynapi:hasCondition event_condition:name_check . + +creation_properties:step3 + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 3"@en-US ; + dynapi:hasOperation execute_template:n3_template_name ; + dynapi:hasNextStep creation_properties:conditional_for_step4 . + +creation_properties:conditional_for_step4 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event abbreviation check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step4 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step5 ; + dynapi:hasCondition event_condition:abbreviation_check . + +creation_properties:step4 + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 4"@en-US ; + dynapi:hasOperation execute_template:n3_template_abbreviation ; + dynapi:hasNextStep creation_properties:conditional_for_step5 . + +creation_properties:conditional_for_step5 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event startDate check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step5 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step6 ; + dynapi:hasCondition event_condition:startDate_check . + +creation_properties:step5 + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 5"@en-US ; + dynapi:hasOperation execute_template:n3_template_startDate ; + dynapi:hasNextStep creation_properties:conditional_for_step6 . + +creation_properties:conditional_for_step6 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event endDate check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step6 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step7 ; + dynapi:hasCondition event_condition:endDate_check . + +creation_properties:step6 + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 6"@en-US ; + dynapi:hasOperation execute_template:n3_template_endDate ; + dynapi:hasNextStep creation_properties:conditional_for_step7 . + +creation_properties:conditional_for_step7 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event place check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step7 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step8and9 ; + dynapi:hasCondition event_condition:place_check . + +creation_properties:step7 + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 7"@en-US ; + dynapi:hasOperation execute_template:n3_template_place ; + dynapi:hasNextStep creation_properties:conditional_for_step8and9 . + +creation_properties:conditional_for_step8and9 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event venue check"@en-US ; + dynapi:nextIfSatisfied creation_properties:conditional_for_step8 ; + dynapi:hasCondition event_condition:eventVenue_check . + +creation_properties:conditional_for_step8 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event venue name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step8_unpack ; + dynapi:nextIfNotSatisfied creation_properties:create_eventVenue ; + dynapi:hasCondition event_condition:contains_event_name_key . + +creation_properties:step8_unpack + a dynapi:OperationalStep ; + dynapi:hasNextStep creation_properties:create_eventVenue ; + dynapi:hasOperation unpacking_properties:get_event_venue_name . + +creation_properties:create_eventVenue + a dynapi:OperationalStep ; + dynapi:hasOperation execute_template:event_venue_construct_query_fill_in . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY CREATION +############################################### + +execute_template:n3_template_subject + a dynapi:N3Template ; + rdfs:label "create event N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameter:uri ; + dynapi:N3TextAdditions + """ + ?uri ; + """ . + +execute_template:n3_template_type + a dynapi:N3Template ; + rdfs:label "create event type N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameter:uri ; + dynapi:requiresParameter creation_parameter:type ; + dynapi:N3TextAdditions "?uri ?type . " . + +execute_template:n3_template_name + a dynapi:N3Template ; + rdfs:label "create event name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameter:uri ; + dynapi:requiresParameter creation_parameter:name ; + dynapi:N3TextAdditions "?uri ?name . " . + +execute_template:n3_template_abbreviation + a dynapi:N3Template ; + rdfs:label "create event abbreviation N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameter:uri ; + dynapi:requiresParameter creation_parameter:abbreviation ; + dynapi:N3TextAdditions "?uri ?abbreviation . " . + +execute_template:n3_template_startDate + a dynapi:N3Template ; + rdfs:label "create event startDate N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameter:uri ; + dynapi:requiresParameter creation_parameter:startDate ; + dynapi:N3TextAdditions "?uri ?startDate . " . + +execute_template:n3_template_endDate + a dynapi:N3Template ; + rdfs:label "create event endDate N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameter:uri ; + dynapi:requiresParameter creation_parameter:endDate ; + dynapi:N3TextAdditions "?uri ?endDate . " . + +execute_template:n3_template_place + a dynapi:N3Template ; + rdfs:label "create event place N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameter:uri ; + dynapi:requiresParameter creation_parameter:place ; + dynapi:N3TextAdditions "?uri ?place . " . + +execute_template:event_venue_construct_query_fill_in + a dynapi:N3Template ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameter:venueName ; + dynapi:requiresParameter creation_parameter:venueURI ; + dynapi:requiresParameter creation_parameter:uri ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?venueURI ; + ?venueName . + + ?uri ?venueURI . + """ . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_delete_event.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_delete_event.n3 new file mode 100644 index 000000000..9d4e06694 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_delete_event.n3 @@ -0,0 +1,87 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix event_fetching: . +@prefix event_removal: . +@prefix procedure_unloading: . +@prefix whitelist_access: . +@prefix deletion_parameter: . +@prefix dynapi_model: . + +############################################### +### DELETE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Deleting a OU"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:hasFirstStep event_fetching:step . + +event_fetching:step + a dynapi:OperationalStep ; + dynapi:hasNextStep event_removal:step ; + dynapi:hasOperation event_fetching:operation . + +event_fetching:operation + a dynapi:SparqlConstructQuery ; + dynapi:sparqlQueryText """ + prefix dynapi: + prefix rdf: + prefix rdfs: + prefix xsd: + CONSTRUCT { + ?resource_id + rdf:type ; + ?type ; + ?name ; + ?abbreviation ; + ?startDate ; + ?endDate ; + ?place ; + ?eventVenueURI . + + ?eventVenueURI + rdf:type ; + ?eventVenueName . + + } WHERE { + ?resource_id a . + OPTIONAL { ?uri ?typeOptional } + OPTIONAL { ?uri ?nameOptional } + OPTIONAL { ?uri ?abbreviationOptional } + OPTIONAL { ?uri ?startDateOptional } + OPTIONAL { ?uri ?endDateOptional } + OPTIONAL { ?uri ?placeOptional } + OPTIONAL { + ?resource_id ?eventVenueURI . + OPTIONAL { ?eventVenueURI ?eventVenueName } + } + } + """ ; + dynapi:providesParameter deletion_parameter:event_graph ; + dynapi:requiresParameter deletion_parameter:resource_id ; + dynapi:hasModel dynapi_model:full_union . + +event_removal:step + a dynapi:OperationalStep ; + dynapi:hasNextStep procedure_unloading:step ; + dynapi:hasOperation event_removal:operation . + +event_removal:operation + a dynapi:ModelWriter ; + dynapi:retractionModel deletion_parameter:event_graph ; + dynapi:targetModel dynapi_model:abox_assertions . + +procedure_unloading:step + a dynapi:OperationalStep ; + dynapi:hasOperation procedure_unloading:operation . + +procedure_unloading:operation + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter deletion_parameter:resource_id . \ No newline at end of file diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_read_all_events.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_read_all_events.n3 new file mode 100644 index 000000000..8a7c6c90e --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_read_all_events.n3 @@ -0,0 +1,90 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix whitelist_access: . +@prefix fetching_properties: . +@prefix statistics: . +@prefix dynapi_model: . +@prefix response_parameters: . +@prefix request_parameters: . + +############################################### +### READ (all) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching OUs"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:providesParameter response_parameters:events ; + dynapi:providesParameter response_parameters:count ; + dynapi:hasFirstStep fetching_properties:step . + +fetching_properties:step + a dynapi:OperationalStep ; + rdfs:label "fetch events step"@en-US ; + dynapi:hasOperation fetching_properties:sparql_select_query ; + dynapi:hasNextStep statistics:step . + +fetching_properties:sparql_select_query + a dynapi:SparqlSelectQuery ; + rdfs:label "read events sparql query"@en-US ; + dynapi:hasModel dynapi_model:full_union ; + dynapi:providesParameter response_parameters:events ; + dynapi:requiresPlainParameter request_parameters:limit ; + dynapi:requiresPlainParameter request_parameters:offset ; + dynapi:requiresPlainParameter request_parameters:sortBy ; + dynapi:requiresPlainParameter request_parameters:order ; + dynapi:sparqlQueryText + """ + SELECT ?uri (GROUP_CONCAT(DISTINCT ?typeOptional; separator=" -> ") as ?type) + (SAMPLE(?nameOptional) as ?name) + (SAMPLE(?abbreviationOptional) as ?abbreviation) + (SAMPLE(?startDateOptional) as ?startDate) + (SAMPLE(?endDateOptional) as ?endDate) + (SAMPLE(?placeOptional) as ?place) + (SAMPLE(CONCAT( + '{"uri":"', IF(BOUND(?eventVenueURI), STR(?eventVenueURI), ''), + '", "name":"', IF(BOUND(?eventVenueName), STR(?eventVenueName), ''), + '"}' + )) as ?eventVenue) + WHERE { + ?uri a . + OPTIONAL { ?uri ?typeOptional } + OPTIONAL { ?uri ?nameOptional } + OPTIONAL { ?uri ?abbreviationOptional } + OPTIONAL { ?uri ?startDateOptional } + OPTIONAL { ?uri ?endDateOptional } + OPTIONAL { ?uri ?placeOptional } + OPTIONAL { + ?uri ?eventVenueURI . + OPTIONAL { ?eventVenueURI ?eventVenueName } + } + } + GROUP BY ?uri + ORDER BY ?label + LIMIT ?limit OFFSET ?offset + """ . + +statistics:step + a dynapi:OperationalStep ; + rdfs:label "number of events step "@en-US ; + dynapi:hasOperation statistics:sparql_query . + +statistics:sparql_query + a dynapi:SparqlSelectQuery ; + rdfs:label "number of events sparql query 1"@en-US ; + dynapi:hasModel dynapi_model:full_union ; + dynapi:providesParameter response_parameters:count ; + dynapi:sparqlQueryText + """ + SELECT (count(distinct ?uri) as ?count) + WHERE + { + ?uri + } + """ . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_read_event.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_read_event.n3 new file mode 100644 index 000000000..14d8c4956 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_read_event.n3 @@ -0,0 +1,64 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix response_parameters: . +@prefix read_parameters: . +@prefix dynapi_model: . +@prefix whitelist_access: . +@prefix fetching_properties: . + +############################################### +### READ (one) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching an event"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:providesParameter response_parameters:events ; + dynapi:hasFirstStep fetching_properties:step . + +fetching_properties:step + a dynapi:OperationalStep ; + rdfs:label "reading of an event"@en-US ; + dynapi:hasOperation fetching_properties:sparql_query . + +fetching_properties:sparql_query + a dynapi:SparqlSelectQuery ; + rdfs:label "read event sparql query"@en-US ; + dynapi:hasModel dynapi_model:full_union ; + dynapi:requiresParameter read_parameters:resource_id ; + dynapi:providesParameter response_parameters:events ; + dynapi:sparqlQueryText + """ + SELECT ?uri (GROUP_CONCAT(DISTINCT ?typeOptional; separator=" -> ") as ?type) + (SAMPLE(?nameOptional) as ?name) + (SAMPLE(?abbreviationOptional) as ?abbreviation) + (SAMPLE(?startDateOptional) as ?startDate) + (SAMPLE(?endDateOptional) as ?endDate) + (SAMPLE(?placeOptional) as ?place) + (SAMPLE(CONCAT( + '{"uri":"', IF(BOUND(?eventVenueURI), STR(?eventVenueURI), ''), + '", "name":"', IF(BOUND(?eventVenueName), STR(?eventVenueName), ''), + '"}' + )) as ?eventVenue) + WHERE { + ?uri a . + OPTIONAL { ?uri ?typeOptional } + OPTIONAL { ?uri ?nameOptional } + OPTIONAL { ?uri ?abbreviationOptional } + OPTIONAL { ?uri ?startDateOptional } + OPTIONAL { ?uri ?endDateOptional } + OPTIONAL { ?uri ?placeOptional } + OPTIONAL { + ?uri ?eventVenueURI . + OPTIONAL { ?eventVenueURI ?eventVenueName } + } + FILTER( ?uri = ?resource_id) + } + GROUP BY ?uri + """ . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/enpoint_procedure_update_event.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/enpoint_procedure_update_event.n3 new file mode 100644 index 000000000..41aee343f --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/enpoint_procedure_update_event.n3 @@ -0,0 +1,89 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix dynapi_model: . +@prefix execute_template: . +@prefix update_parameter: . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY UPDATE +############################################### + +execute_template:n3_template_subject + a dynapi:N3Template ; + rdfs:label "create event N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter update_parameter:resource_id ; + dynapi:N3TextAdditions + """ + ?resource_id ; + """ . + +execute_template:n3_template_type + a dynapi:N3Template ; + rdfs:label "create event type N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter update_parameter:resource_id ; + dynapi:requiresParameter update_parameter:type ; + dynapi:N3TextAdditions "?resource_id ?type . " . + +execute_template:n3_template_name + a dynapi:N3Template ; + rdfs:label "create event name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter update_parameter:resource_id ; + dynapi:requiresParameter update_parameter:name ; + dynapi:N3TextAdditions "?resource_id ?name . " . + +execute_template:n3_template_abbreviation + a dynapi:N3Template ; + rdfs:label "create event abbreviation N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter update_parameter:resource_id ; + dynapi:requiresParameter update_parameter:abbreviation ; + dynapi:N3TextAdditions "?resource_id ?abbreviation . " . + +execute_template:n3_template_startDate + a dynapi:N3Template ; + rdfs:label "create event startDate N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter update_parameter:resource_id ; + dynapi:requiresParameter update_parameter:startDate ; + dynapi:N3TextAdditions "?resource_id ?startDate . " . + +execute_template:n3_template_endDate + a dynapi:N3Template ; + rdfs:label "create event endDate N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter update_parameter:resource_id ; + dynapi:requiresParameter update_parameter:endDate ; + dynapi:N3TextAdditions "?resource_id ?endDate . " . + +execute_template:n3_template_place + a dynapi:N3Template ; + rdfs:label "create event place N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter update_parameter:resource_id ; + dynapi:requiresParameter update_parameter:place ; + dynapi:N3TextAdditions "?resource_id ?place . " . + +execute_template:event_venue_construct_query_fill_in + a dynapi:N3Template ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter update_parameter:venueName ; + dynapi:requiresParameter update_parameter:venueURI ; + dynapi:requiresParameter update_parameter:resource_id ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?venueURI ; + ?venueName . + + ?resource_id ?venueURI . + """ . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_API.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_API.n3 new file mode 100644 index 000000000..d07e7a94e --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_API.n3 @@ -0,0 +1,15 @@ +@prefix rdfs: . +@prefix dynapi: . + + + + + a dynapi:ResourceAPI ; + rdfs:label "events resource API 1"@en-US ; + dynapi:name "event" ; + dynapi:minAPIVersion "0.1.0" ; + dynapi:onPost ; + dynapi:onGetAll ; + dynapi:onGet ; + dynapi:onPut ; + dynapi:onDelete . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_parameters.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_parameters.n3 new file mode 100644 index 000000000..0dae5d65c --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_parameters.n3 @@ -0,0 +1,183 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix dynapi_type: . +@prefix response_parameters: . +@prefix request_parameters: . + +############################################### +### PARAMETERS +############################################### + +#################### +## Event response ## +#################### + +response_parameters:events + a dynapi:Parameter ; + rdfs:label "events"@en-US ; + dynapi:name "events" ; + dynapi:description "List of available events and statistics (number)" ; + dynapi:hasType dynapi_type:JsonContainerArray . + +response_parameters:count + a dynapi:Parameter ; + rdfs:label "Number of fetched events"@en-US ; + dynapi:name "count" ; + dynapi:hasType dynapi_type:JsonContainer . + +##################### +## Creation fields ## +##################### + +request_parameters:uri + a dynapi:Parameter ; + dynapi:name "uri" ; + dynapi:defaultValue "http://purl.org/NET/c4dm/event.owl/Event#,java_uuid_number" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:generated-uri . + +request_parameters:type + a dynapi:Parameter ; + dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:uri . + +request_parameters:name + a dynapi:Parameter ; + dynapi:name "name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameters:abbreviation + a dynapi:Parameter ; + dynapi:name "abbreviation" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameters:startDate + a dynapi:Parameter ; + dynapi:name "startDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameters:endDate + a dynapi:Parameter ; + dynapi:name "endDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameters:place + a dynapi:Parameter ; + dynapi:name "place" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameters:eventVenue + a dynapi:Parameter ; + dynapi:name "eventVenue" ; + dynapi:defaultValue "{}" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:JsonContainer . + +request_parameters:venueURI + a dynapi:Parameter ; + dynapi:name "venueURI" ; + dynapi:defaultValue "http://www.w3.org/2006/vcard/ns/Individual#,java_uuid_number" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:generated-uri . + +request_parameters:venueName + a dynapi:Parameter ; + dynapi:name "venueName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +# Event Venue keys + +request_parameters:eventVenueName_key + a dynapi:Parameter ; + dynapi:name "eventVenueName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "name" ; + dynapi:hasType dynapi_type:string . + +######################### +## Read request fields ## +######################### + +request_parameters:resource_id + a dynapi:Parameter ; + dynapi:name "resource_id" ; + dynapi:hasType dynapi_type:uri ; + rdfs:label "resource uri"@en-US . + +request_parameters:total + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType dynapi_type:integer ; + rdfs:label "total"@en-US . + +request_parameters:limit + a dynapi:parameter ; + dynapi:name "limit" ; + dynapi:defaultValue "20" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:integer ; + rdfs:label "limit"@en-US . + +request_parameters:offset + a dynapi:parameter ; + dynapi:name "offset" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:integer ; + rdfs:label "offset"@en-US . + +request_parameters:sortBy + a dynapi:parameter ; + dynapi:name "sortBy" ; + dynapi:defaultValue "label" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string ; + rdfs:label "sortBy"@en-US . + +request_parameters:order + a dynapi:parameter ; + dynapi:name "order" ; + dynapi:defaultValue "ASC" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string ; + rdfs:label "order"@en-US . + +########################### +## Delete request fields ## +########################### + +request_parameters:event_graph + a dynapi:Model ; + dynapi:name "event_graph" ; + dynapi:hasType dynapi_type:model . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_utils.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_utils.n3 new file mode 100644 index 000000000..361957c35 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_utils.n3 @@ -0,0 +1,73 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix unpacking_properties: . +@prefix condition: . +@prefix creation_parameters: . +@prefix whitelist_access: . + +########################## +## Unpacking operations ## +########################## + +unpacking_properties:get_event_venue_name + a dynapi:ContainerQuery ; + dynapi:targetContainer creation_parameters:eventVenue ; + dynapi:requiresParameter creation_parameters:eventVenueName_key ; + dynapi:providesParameter creation_parameters:venueName . + +############################################### +### PARAMETER CHECKS +############################################### + +condition:type_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event type is defined"@en-US ; + dynapi:requiresParameter creation_parameters:type . + +condition:name_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event name is defined"@en-US ; + dynapi:requiresParameter creation_parameters:name . + +condition:abbreviation_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event abbreviation is defined"@en-US ; + dynapi:requiresParameter creation_parameters:abbreviation . + +condition:startDate_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event startDate is defined"@en-US ; + dynapi:requiresParameter creation_parameters:startDate . + +condition:endDate_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event endDate is defined"@en-US ; + dynapi:requiresParameter creation_parameters:endDate . + +condition:place_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event place is defined"@en-US ; + dynapi:requiresParameter creation_parameters:place . + +condition:eventVenue_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event venue is defined"@en-US ; + dynapi:requiresParameter creation_parameters:eventVenue . + +condition:contains_event_name_key + a dynapi:ConditionContainerContains ; + dynapi:targetContainer creation_parameters:eventVenue ; + dynapi:requiresParameter creation_parameters:eventVenueName_key . + +############################################### +### ACCESS CONTROL +############################################### + +whitelist_access:admin + a dynapi:GroupAccessWhitelist ; + dynapi:userGroup . \ No newline at end of file diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_create_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_create_organisation_unit.n3 new file mode 100644 index 000000000..f8c043b61 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_create_organisation_unit.n3 @@ -0,0 +1,176 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix creation_properties: . +@prefix execute_template: . +@prefix unpacking_properties: . +@prefix dynapi_model: . +@prefix creation_parameters: . +@prefix whitelist_access: . +@prefix condition: . + +############################################### +### CREATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Create an OU"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:hasFirstStep creation_properties:step1 ; + dynapi:providesParameter creation_parameters:uri . + +creation_properties:step1 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 1"@en-US ; + dynapi:hasOperation execute_template:n3_template_subject ; + dynapi:hasNextStep creation_properties:conditional_for_step2 . + +creation_properties:conditional_for_step2 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU type check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step2 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step3 ; + dynapi:hasCondition condition:type_check . + +creation_properties:step2 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 2"@en-US ; + dynapi:hasOperation execute_template:n3_template_type ; + dynapi:hasNextStep creation_properties:conditional_for_step3 . + +creation_properties:conditional_for_step3 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step3 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step4 ; + dynapi:hasCondition condition:name_check . + +creation_properties:step3 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 3"@en-US ; + dynapi:hasOperation execute_template:n3_template_name ; + dynapi:hasNextStep creation_properties:conditional_for_step4 . + +creation_properties:conditional_for_step4 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU description check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step4 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step5and6 ; + dynapi:hasCondition condition:description_check . + +creation_properties:step4 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 4"@en-US ; + dynapi:hasOperation execute_template:n3_template_description ; + dynapi:hasNextStep creation_properties:conditional_for_step5and6 . + +creation_properties:conditional_for_step5and6 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU check"@en-US ; + dynapi:nextIfSatisfied creation_properties:conditional_for_step5 ; + dynapi:hasCondition condition:super_ou_check . + +creation_properties:conditional_for_step5 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU URI check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step5unpack ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step6 ; + dynapi:hasCondition condition:contains_organisation_unit_uri_key . + +creation_properties:step5unpack + a dynapi:OperationalStep ; + dynapi:hasNextStep creation_properties:step5 ; + dynapi:hasOperation unpacking_properties:get_organisation_unit_uri . + +creation_properties:step5 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 5"@en-US ; + dynapi:hasOperation execute_template:n3_template_super_organization_unit_uri ; + dynapi:hasNextStep creation_properties:conditional_for_step6 . + +creation_properties:conditional_for_step6 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step6unpack ; + dynapi:hasCondition condition:contains_organization_unit_name_key . + +creation_properties:step6unpack + a dynapi:OperationalStep ; + dynapi:hasNextStep creation_properties:step6 ; + dynapi:hasOperation unpacking_properties:get_organisation_unit_name . + +creation_properties:step6 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 6"@en-US ; + dynapi:hasOperation execute_template:n3_template_super_organization_unit_name . + +unpacking_properties:get_organisation_unit_uri + a dynapi:ContainerQuery ; + dynapi:targetContainer creation_parameters:superOrganizationUnit ; + dynapi:requiresParameter creation_parameters:superOrganizationUnitURI_key ; + dynapi:providesParameter creation_parameters:superURI . + +unpacking_properties:get_organisation_unit_name + a dynapi:ContainerQuery ; + dynapi:targetContainer creation_parameters:superOrganizationUnit ; + dynapi:requiresParameter creation_parameters:superOrganizationUnitName_key ; + dynapi:providesParameter creation_parameters:superName . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY CREATION +############################################### + +execute_template:n3_template_subject + a dynapi:N3Template ; + rdfs:label "create OU N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:uri ; + dynapi:N3TextAdditions + """ + ?uri ; + """ . + +execute_template:n3_template_type + a dynapi:N3Template ; + rdfs:label "create OU type N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:uri ; + dynapi:requiresParameter creation_parameters:type ; + dynapi:N3TextAdditions "?uri ?type . " . + +execute_template:n3_template_name + a dynapi:N3Template ; + rdfs:label "create OU name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:uri ; + dynapi:requiresParameter creation_parameters:name ; + dynapi:N3TextAdditions "?uri ?name . " . + +execute_template:n3_template_description + a dynapi:N3Template ; + rdfs:label "create OU description N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:uri ; + dynapi:requiresParameter creation_parameters:description ; + dynapi:N3TextAdditions "?uri ?description . " . + +execute_template:n3_template_super_organization_unit_uri + a dynapi:N3Template ; + rdfs:label "create super OU name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:uri ; + dynapi:requiresParameter creation_parameters:superURI ; + dynapi:N3TextAdditions "?uri ?superURI . " . + +execute_template:n3_template_super_organization_unit_name + a dynapi:N3Template ; + rdfs:label "create super OU name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:uri ; + dynapi:requiresParameter creation_parameters:superName ; + dynapi:N3TextAdditions "?uri ?superName . " . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_delete_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_delete_organisation_unit.n3 new file mode 100644 index 000000000..1d788873f --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_delete_organisation_unit.n3 @@ -0,0 +1,76 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix dynapi_model: . +@prefix xsd: . +@prefix fetching_properties: . +@prefix deletion_properties: . +@prefix unloading_properties: . +@prefix deletion_parameters: . +@prefix whitelist_access: . + +############################################### +### DELETE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Deleting an OU"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:hasFirstStep fetching_properties:step . + +fetching_properties:step + a dynapi:OperationalStep ; + dynapi:hasNextStep deletion_properties:step ; + dynapi:hasOperation fetching_properties:operation . + +fetching_properties:operation + a dynapi:SparqlConstructQuery ; + dynapi:sparqlQueryText """ + prefix dynapi: + prefix rdf: + prefix rdfs: + prefix xsd: + CONSTRUCT { + ?resource_id + rdf:type ; + ?type ; + ?name ; + ?description ; + ?superOrganizationUnitUri ; + ?superOrganizationUnitName . + + } WHERE { + ?resource_id a . + OPTIONAL { ?uri ?type } + OPTIONAL { ?uri ?name } + OPTIONAL { ?uri ?description } + OPTIONAL { ?uri ?superOrganizationUnitUri } + OPTIONAL { ?uri ?superOrganizationUnitName } + } + """ ; + dynapi:providesParameter deletion_parameters:organization_unit_graph ; + dynapi:requiresParameter deletion_parameters:resource_id ; + dynapi:hasModel dynapi_model:full_union . + +deletion_properties:step + a dynapi:OperationalStep ; + dynapi:hasNextStep unloading_properties:step ; + dynapi:hasOperation deletion_properties:operation . + +deletion_properties:operation + a dynapi:ModelWriter ; + dynapi:retractionModel deletion_parameters:organization_unit_graph ; + dynapi:targetModel dynapi_model:abox_assertions . + +unloading_properties:step + a dynapi:OperationalStep ; + dynapi:hasOperation unloading_properties:operation . + +unloading_properties:operation + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter deletion_parameters:resource_id . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_read_all_organisation_units.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_read_all_organisation_units.n3 new file mode 100644 index 000000000..e4e77559a --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_read_all_organisation_units.n3 @@ -0,0 +1,79 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix dynapi_model: . +@prefix xsd: . +@prefix response_parameters: . +@prefix read_parameters: . +@prefix fetching_properties: . +@prefix whitelist_access: . +@prefix statistics: . + +############################################### +### READ (all) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching OUs"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:providesParameter response_parameters:organizationUnits ; + dynapi:providesParameter response_parameters:count ; + dynapi:hasFirstStep fetching_properties:step . + +fetching_properties:step + a dynapi:OperationalStep ; + rdfs:label "fetch OUs step"@en-US ; + dynapi:hasOperation fetching_properties:sparql_select_query ; + dynapi:hasNextStep statistics:step . + +fetching_properties:sparql_select_query + a dynapi:SparqlSelectQuery ; + rdfs:label "read OUs sparql query"@en-US ; + dynapi:hasModel dynapi_model:full_union ; + dynapi:providesParameter response_parameters:organizationUnits ; + dynapi:requiresPlainParameter read_parameters:limit ; + dynapi:requiresPlainParameter read_parameters:offset ; + dynapi:requiresPlainParameter read_parameters:sortBy ; + dynapi:requiresPlainParameter read_parameters:order ; + dynapi:sparqlQueryText + """ + SELECT ?uri (GROUP_CONCAT(DISTINCT ?typeOptional; separator=" -> ") as ?type) + (SAMPLE(?nameOptional) as ?name) + (SAMPLE(?descriptionOptional) as ?description) + (SAMPLE(?superOrganizationUnitUriOptional) as ?superOrganizationUnitUri) + (SAMPLE(?superOrganizationUnitNameOptional) as ?superOrganizationUnitName) + WHERE { + ?uri a . + OPTIONAL { ?uri ?typeOptional } + OPTIONAL { ?uri ?nameOptional } + OPTIONAL { ?uri ?descriptionOptional } + OPTIONAL { ?uri ?superOrganizationUnitUriOptional } + OPTIONAL { ?uri ?superOrganizationUnitNameOptional } + } + GROUP BY ?uri + ORDER BY ?label + LIMIT ?limit OFFSET ?offset + """ . + +statistics:step + a dynapi:OperationalStep ; + rdfs:label "number of OUs step "@en-US ; + dynapi:hasOperation statistics:sparql_query . + +statistics:sparql_query + a dynapi:SparqlSelectQuery ; + rdfs:label "number of OUs sparql query 1"@en-US ; + dynapi:hasModel dynapi_model:full_union ; + dynapi:providesParameter response_parameters:count ; + dynapi:sparqlQueryText + """ + SELECT (count(distinct ?uri) as ?count) + WHERE + { + ?uri + } + """ . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_read_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_read_organisation_unit.n3 new file mode 100644 index 000000000..1aee1303d --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_read_organisation_unit.n3 @@ -0,0 +1,53 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix dynapi_model: . +@prefix xsd: . +@prefix fetching_properties: . +@prefix whitelist_access: . +@prefix response_parameters: . +@prefix fetching_parameters: . + +############################################### +### READ (one) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching an OU"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:providesParameter response_parameters:organizationUnits ; + dynapi:hasFirstStep fetching_properties:step . + +fetching_properties:step + a dynapi:OperationalStep ; + rdfs:label "reading of an OU"@en-US ; + dynapi:hasOperation fetching_properties:sparql_query . + +fetching_properties:sparql_query + a dynapi:SparqlSelectQuery ; + rdfs:label "read OU sparql query 1"@en-US ; + dynapi:hasModel dynapi_model:full_union ; + dynapi:requiresParameter fetching_parameters:resource_id ; + dynapi:providesParameter response_parameters:organizationUnits ; + dynapi:sparqlQueryText + """ + SELECT ?uri (GROUP_CONCAT(DISTINCT ?typeOptional; separator=" -> ") as ?type) + (SAMPLE(?nameOptional) as ?name) + (SAMPLE(?descriptionOptional) as ?description) + (SAMPLE(?superOrganizationUnitUriOptional) as ?superOrganizationUnitUri) + (SAMPLE(?superOrganizationUnitNameOptional) as ?superOrganizationUnitName) + WHERE { + ?uri a . + OPTIONAL { ?uri ?typeOptional } + OPTIONAL { ?uri ?nameOptional } + OPTIONAL { ?uri ?descriptionOptional } + OPTIONAL { ?uri ?superOrganizationUnitUriOptional } + OPTIONAL { ?uri ?superOrganizationUnitNameOptional } + FILTER( ?uri = ?resource_id) + } + GROUP BY ?uri + """ . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_update_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_update_organisation_unit.n3 new file mode 100644 index 000000000..4a1c1a95a --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_update_organisation_unit.n3 @@ -0,0 +1,191 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix creation_properties: . +@prefix fetch_ou: . +@prefix remove_ou_from_model: . +@prefix unload_ou_from_pool: . +@prefix execute_template: . +@prefix whitelist_access: . +@prefix condition: . +@prefix creation_parameters: . +@prefix unpacking_properties: . +@prefix dynapi_model: . + +############################################### +### UPDATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Updating a OU"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:hasFirstStep fetch_ou:step . + +fetch_ou:step + a dynapi:OperationalStep ; + dynapi:hasNextStep remove_ou_from_model:step ; + dynapi:hasOperation . + +remove_ou_from_model:step + a dynapi:OperationalStep ; + dynapi:hasNextStep unload_ou_from_pool:step ; + dynapi:hasOperation remove_ou_from_model:operation . + +remove_ou_from_model:operation + a dynapi:ModelWriter ; + dynapi:retractionModel creation_parameters:organization_unit_graph ; + dynapi:targetModel dynapi_model:abox_assertions . + +unload_ou_from_pool:step + a dynapi:OperationalStep ; + dynapi:hasNextStep creation_properties:step1 ; + dynapi:hasOperation unload_ou_from_pool:operation . + +unload_ou_from_pool:operation + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter creation_parameters:resource_id . + +creation_properties:step1 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 1"@en-US ; + dynapi:hasOperation execute_template:n3_template_subject ; + dynapi:hasNextStep creation_properties:conditional_for_step2 . + +creation_properties:conditional_for_step2 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU type check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step2 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step3 ; + dynapi:hasCondition condition:type_check . + +creation_properties:step2 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 2"@en-US ; + dynapi:hasOperation execute_template:n3_template_type ; + dynapi:hasNextStep creation_properties:conditional_for_step3 . + +creation_properties:conditional_for_step3 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step3 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step4 ; + dynapi:hasCondition condition:name_check . + +creation_properties:step3 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 3"@en-US ; + dynapi:hasOperation execute_template:n3_template_name ; + dynapi:hasNextStep creation_properties:conditional_for_step4 . + +creation_properties:conditional_for_step4 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU description check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step4 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step5and6 ; + dynapi:hasCondition condition:description_check . + +creation_properties:step4 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 4"@en-US ; + dynapi:hasOperation execute_template:n3_template_description ; + dynapi:hasNextStep creation_properties:conditional_for_step5and6 . + +creation_properties:conditional_for_step5and6 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU check"@en-US ; + dynapi:nextIfSatisfied creation_properties:conditional_for_step5 ; + dynapi:hasCondition condition:super_ou_check . + +creation_properties:conditional_for_step5 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU URI check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step5unpack ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step6 ; + dynapi:hasCondition condition:contains_organisation_unit_uri_key . + +creation_properties:step5unpack + a dynapi:OperationalStep ; + dynapi:hasNextStep creation_properties:step5 ; + dynapi:hasOperation unpacking_properties:get_organisation_unit_uri . + +creation_properties:step5 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 5"@en-US ; + dynapi:hasOperation execute_template:n3_template_super_organization_unit_uri ; + dynapi:hasNextStep creation_properties:conditional_for_step6 . + +creation_properties:conditional_for_step6 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step6unpack ; + dynapi:hasCondition condition:contains_organization_unit_name_key . + +creation_properties:step6unpack + a dynapi:OperationalStep ; + dynapi:hasNextStep creation_properties:step6 ; + dynapi:hasOperation unpacking_properties:get_organisation_unit_name . + +creation_properties:step6 + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 6"@en-US ; + dynapi:hasOperation execute_template:n3_template_super_organization_unit_name . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY UPDATE +############################################### + +execute_template:n3_template_subject + a dynapi:N3Template ; + rdfs:label "update OU N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:resource_id ; + dynapi:N3TextAdditions + """ + ?resource_id ; + """ . + +execute_template:n3_template_type + a dynapi:N3Template ; + rdfs:label "update OU type N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:resource_id ; + dynapi:requiresParameter creation_parameters:type ; + dynapi:N3TextAdditions "?resource_id ?type . " . + +execute_template:n3_template_name + a dynapi:N3Template ; + rdfs:label "update OU name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:resource_id ; + dynapi:requiresParameter creation_parameters:name ; + dynapi:N3TextAdditions "?resource_id ?name . " . + +execute_template:n3_template_description + a dynapi:N3Template ; + rdfs:label "update OU description N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:resource_id ; + dynapi:requiresParameter creation_parameters:description ; + dynapi:N3TextAdditions "?resource_id ?description . " . + +execute_template:n3_template_super_organization_unit_uri + a dynapi:N3Template ; + rdfs:label "update super OU name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:resource_id ; + dynapi:requiresParameter creation_parameters:superURI ; + dynapi:N3TextAdditions "?resource_id ?superURI . " . + +execute_template:n3_template_super_organization_unit_name + a dynapi:N3Template ; + rdfs:label "update super OU name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter creation_parameters:resource_id ; + dynapi:requiresParameter creation_parameters:superName ; + dynapi:N3TextAdditions "?resource_id ?superName . " . \ No newline at end of file diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_API.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_API.n3 new file mode 100644 index 000000000..8d1189ed7 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_API.n3 @@ -0,0 +1,15 @@ +@prefix rdfs: . +@prefix dynapi: . + + + + + a dynapi:ResourceAPI ; + rdfs:label "organisation units resource API 1"@en-US ; + dynapi:name "organisation_unit" ; + dynapi:minAPIVersion "0.1.0" ; + dynapi:onPost ; + dynapi:onGetAll ; + dynapi:onGet ; + dynapi:onPut ; + dynapi:onDelete . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_parameters.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_parameters.n3 new file mode 100644 index 000000000..b06e52e33 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_parameters.n3 @@ -0,0 +1,168 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix dynapi_type: . +@prefix response_parameters: . +@prefix request_parameters: . + + +############################################### +### PARAMETERS +############################################### + +################################ +## Organization unit response ## +################################ + +response_parameters:organizationUnits + a dynapi:Parameter ; + rdfs:label "organizationUnits"@en-US ; + dynapi:name "organizationUnits" ; + dynapi:description "List of available OUs and statistics (number)" ; + dynapi:hasType dynapi_type:JsonContainerArray . + +response_parameters:count + a dynapi:Parameter ; + rdfs:label "Number of fetched OUs"@en-US ; + dynapi:name "count" ; + dynapi:hasType dynapi_type:JsonContainer . + +##################### +## Creation fields ## +##################### + +request_parameters:uri + a dynapi:Parameter ; + dynapi:name "uri" ; + dynapi:defaultValue "http://xmlns.com/foaf/0.1/Organization#,java_uuid_number" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:generated-uri . + +request_parameters:type + a dynapi:Parameter ; + dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:uri . + +request_parameters:name + a dynapi:Parameter ; + dynapi:name "name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameters:description + a dynapi:Parameter ; + dynapi:name "description" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameters:superURI + a dynapi:Parameter ; + dynapi:name "superURI" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:uri . + +request_parameters:superName + a dynapi:Parameter ; + dynapi:name "superName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameters:superOrganizationUnit + a dynapi:Parameter ; + dynapi:name "superOrganizationUnit" ; + dynapi:defaultValue "{}" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:JsonContainer . + +# Super Organisation Unit keys + +request_parameters:superOrganizationUnitURI_key + a dynapi:Parameter ; + dynapi:name "superOrganizationUnitURI_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "uri" ; + dynapi:hasType dynapi_type:string . + +request_parameters:superOrganizationUnitName_key + a dynapi:Parameter ; + dynapi:name "superOrganizationUnitName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "name" ; + dynapi:hasType dynapi_type:string . + +######################### +## Read request fields ## +######################### + +request_parameters:resource_id + a dynapi:Parameter ; + dynapi:name "resource_id" ; + dynapi:hasType dynapi_type:uri ; + rdfs:label "resource uri"@en-US . + +request_parameters:total + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType dynapi_type:integer ; + rdfs:label "total"@en-US . + +request_parameters:limit + a dynapi:parameter ; + dynapi:name "limit" ; + dynapi:defaultValue "20" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:integer ; + rdfs:label "limit"@en-US . + +request_parameters:offset + a dynapi:parameter ; + dynapi:name "offset" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:integer ; + rdfs:label "offset"@en-US . + +request_parameters:sortBy + a dynapi:parameter ; + dynapi:name "sortBy" ; + dynapi:defaultValue "label" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string ; + rdfs:label "sortBy"@en-US . + +request_parameters:order + a dynapi:parameter ; + dynapi:name "order" ; + dynapi:defaultValue "ASC" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string ; + rdfs:label "order"@en-US . + +########################### +## Delete request fields ## +########################### + +request_parameters:organization_unit_graph + a dynapi:Model ; + dynapi:name "organization_unit_graph" ; + dynapi:hasType dynapi_type:model . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_utils.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_utils.n3 new file mode 100644 index 000000000..478c5d952 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_utils.n3 @@ -0,0 +1,62 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix creation_parameters: . +@prefix whitelist_access: . +@prefix condition: . + +############################################### +### PARAMETER CHECKS +############################################### + +condition:type_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if OU type is defined"@en-US ; + dynapi:requiresParameter creation_parameters:type . + +condition:name_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if OU name is defined"@en-US ; + dynapi:requiresParameter creation_parameters:name . + +condition:description_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if OU description is defined"@en-US ; + dynapi:requiresParameter creation_parameters:description . + +condition:super_uri_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if super OU is defined"@en-US ; + dynapi:requiresParameter creation_parameters:superURI . + +condition:super_name_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if super OU name is defined"@en-US ; + dynapi:requiresParameter creation_parameters:superName . + +condition:super_ou_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if super OU is defined"@en-US ; + dynapi:requiresParameter creation_parameters:superOrganizationUnit . + +condition:contains_organisation_unit_uri_key + a dynapi:ConditionContainerContains ; + dynapi:targetContainer creation_parameters:superOrganizationUnit ; + dynapi:requiresParameter creation_parameters:superOrganizationUnitURI_key . + +condition:contains_organization_unit_name_key + a dynapi:ConditionContainerContains ; + dynapi:targetContainer creation_parameters:superOrganizationUnit ; + dynapi:requiresParameter creation_parameters:superOrganizationUnitName_key . + +############################################### +### ACCESS CONTROL +############################################### + +whitelist_access:admin + a dynapi:GroupAccessWhitelist ; + dynapi:userGroup . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_create_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_create_person.n3 new file mode 100644 index 000000000..d20ba93dd --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_create_person.n3 @@ -0,0 +1,277 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix dynapi_model: . +@prefix xsd: . +@prefix creation_properties: . +@prefix execute_template: . +@prefix condition: . +@prefix person_parameter: . +@prefix create_person_positions: . +@prefix iteration_parameter: . +@prefix whitelist_access: . + +############################################### +### CREATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Create a person"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:hasFirstStep creation_properties:step1 ; + dynapi:providesParameter person_parameter:uri . + +creation_properties:step1 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation execute_template:n3_template_subject ; + dynapi:hasNextStep creation_properties:conditional_for_step2 . + +creation_properties:conditional_for_step2 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step2 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step3 ; + dynapi:hasCondition condition:first_name_check . + +creation_properties:step2 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 2"@en-US ; + dynapi:hasOperation execute_template:n3_template_first_name ; + dynapi:hasNextStep creation_properties:conditional_for_step3 . + +creation_properties:conditional_for_step3 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person middle name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step3 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step4 ; + dynapi:hasCondition condition:middle_name_check . + +creation_properties:step3 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 3"@en-US ; + dynapi:hasOperation execute_template:n3_template_middle_name ; + dynapi:hasNextStep creation_properties:conditional_for_step4 . + +creation_properties:conditional_for_step4 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person last name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step4 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step5 ; + dynapi:hasCondition condition:last_name_check . + +creation_properties:step4 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 4"@en-US ; + dynapi:hasOperation execute_template:n3_template_last_name ; + dynapi:hasNextStep creation_properties:conditional_for_step5 . + +creation_properties:conditional_for_step5 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person type check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step5 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step6 ; + dynapi:hasCondition condition:type_check . + +creation_properties:step5 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 5"@en-US ; + dynapi:hasOperation execute_template:n3_template_type ; + dynapi:hasNextStep creation_properties:conditional_for_step6 . + +creation_properties:conditional_for_step6 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person internal id check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step6 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step7 ; + dynapi:hasCondition condition:internal_id_check . + +creation_properties:step6 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 6"@en-US ; + dynapi:hasOperation execute_template:n3_template_internal_id ; + dynapi:hasNextStep creation_properties:conditional_for_step7 . + +creation_properties:conditional_for_step7 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person ORCID check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step7 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step8 ; + dynapi:hasCondition condition:orcid_check . + +creation_properties:step7 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 7"@en-US ; + dynapi:hasOperation execute_template:n3_template_orcid ; + dynapi:hasNextStep creation_properties:conditional_for_step8 . + +creation_properties:conditional_for_step8 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for scopus ID check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step8 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step9 ; + dynapi:hasCondition condition:scopus_author_id_check . + +creation_properties:step8 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 8"@en-US ; + dynapi:hasOperation execute_template:n3_template_scopus_id ; + dynapi:hasNextStep creation_properties:conditional_for_step9 . + +creation_properties:conditional_for_step9 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person researcher ID check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step9 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step10 ; + dynapi:hasCondition condition:researcher_id_check . + +creation_properties:step9 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 9"@en-US ; + dynapi:hasOperation execute_template:n3_template_researcher_id ; + dynapi:hasNextStep creation_properties:conditional_for_step10 . + +creation_properties:conditional_for_step10 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person positions check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step10 ; + dynapi:hasCondition condition:positions_check . + +creation_properties:substitution + a dynapi:ParameterSubstitution ; + dynapi:substitutionSource person_parameter:uri ; + dynapi:substitutionTarget person_parameter:current_uri_persisted . + +creation_properties:step10 + a dynapi:OperationalStep ; + dynapi:hasParameterSubstitution creation_properties:substitution ; + dynapi:hasOperation create_person_positions:loop ; + rdfs:label "Create provided person positions"@en-US . + +## Loop start + +create_person_positions:loop + a dynapi:LoopOperation ; + dynapi:inputDescriptor create_person_positions:input_descriptor ; + dynapi:conditionDescriptor create_person_positions:condition_descriptor ; + + dynapi:outputDescriptor create_person_positions:output_descriptor ; + dynapi:executableDescriptor create_person_positions:executable_descriptor ; + + dynapi:internalParameter iteration_parameter:iteration_int_param ; + + dynapi:internalParameter iteration_parameter:current_positions_item ; + dynapi:providesParameter iteration_parameter:current_positions_item . + +create_person_positions:input_descriptor + a dynapi:ProcedureDescriptor ; + dynapi:providesParameter iteration_parameter:current_positions_item ; + dynapi:requiresParameter iteration_parameter:iteration_int_param ; + dynapi:requiresParameter person_parameter:positions ; + dynapi:call . + +create_person_positions:condition_descriptor + a dynapi:ProcedureDescriptor ; + dynapi:providesParameter iteration_parameter:expected_int_result_1 ; + dynapi:requiresParameter iteration_parameter:iteration_int_param ; + dynapi:requiresParameter person_parameter:positions ; + dynapi:call . + +create_person_positions:output_descriptor + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter iteration_parameter:iteration_int_param ; + dynapi:providesParameter iteration_parameter:iteration_int_param ; + dynapi:call . + +create_person_positions:executable_descriptor + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter iteration_parameter:current_step_uri ; + dynapi:requiresParameter person_parameter:current_uri_persisted ; + dynapi:requiresParameter iteration_parameter:current_positions_item ; + dynapi:call . + +## Loop end + +############################################### +### N3 TEMPLATE PARTIAL ENTITY CREATION +############################################### + +execute_template:n3_template_subject + a dynapi:N3Template ; + rdfs:label "create person N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:uri ; + dynapi:requiresParameter person_parameter:label ; + dynapi:N3TextAdditions + """ + ?uri ; + ?label . + """ . + +execute_template:n3_template_first_name + a dynapi:N3Template ; + rdfs:label "create person first name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:uri ; + dynapi:requiresParameter person_parameter:first_name ; + dynapi:N3TextAdditions "?uri ?first_name . " . + +execute_template:n3_template_middle_name + a dynapi:N3Template ; + rdfs:label "create person middle name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:uri ; + dynapi:requiresParameter person_parameter:middle_name ; + dynapi:N3TextAdditions "?uri ?middle_name . " . + +execute_template:n3_template_last_name + a dynapi:N3Template ; + rdfs:label "create person last name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:uri ; + dynapi:requiresParameter person_parameter:last_name ; + dynapi:N3TextAdditions "?uri ?last_name . " . + +execute_template:n3_template_type + a dynapi:N3Template ; + rdfs:label "create person type N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:uri ; + dynapi:requiresParameter person_parameter:type ; + dynapi:N3TextAdditions "?uri ?type . " . + +execute_template:n3_template_internal_id + a dynapi:N3Template ; + rdfs:label "create person internal id N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:uri ; + dynapi:requiresParameter person_parameter:internalID ; + dynapi:N3TextAdditions "?uri ?internalID . " . + +execute_template:n3_template_orcid + a dynapi:N3Template ; + rdfs:label "create person ORCID N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:uri ; + dynapi:requiresParameter person_parameter:ORCID ; + dynapi:N3TextAdditions "?uri ?ORCID . " . + +execute_template:n3_template_scopus_id + a dynapi:N3Template ; + rdfs:label "create person SCOPUS author ID N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:uri ; + dynapi:requiresParameter person_parameter:SCOPUSAuthorID ; + dynapi:N3TextAdditions "?uri ?SCOPUSAuthorID . " . + +execute_template:n3_template_researcher_id + a dynapi:N3Template ; + rdfs:label "create person researcher ID N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:uri ; + dynapi:requiresParameter person_parameter:ResearcherID ; + dynapi:N3TextAdditions "?uri ?ResearcherID . " . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_delete_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_delete_person.n3 new file mode 100644 index 000000000..9528520fa --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_delete_person.n3 @@ -0,0 +1,99 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix dynapi_model: . +@prefix xsd: . +@prefix get_from_graph: . +@prefix remove_from_graph: . +@prefix unload_from_graph: . +@prefix whitelist_access: . +@prefix person_parameter: . + +############################################### +### DELETE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Deleting a person"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:hasFirstStep get_from_graph:step . + +get_from_graph:step + a dynapi:OperationalStep ; + dynapi:hasNextStep remove_from_graph:step ; + dynapi:hasOperation get_from_graph:operation . + +get_from_graph:operation + a dynapi:SparqlConstructQuery ; + dynapi:sparqlQueryText """ + prefix dynapi: + prefix rdf: + prefix rdfs: + prefix xsd: + CONSTRUCT { + ?resource_id + rdf:type ; + ?first_name ; + ?middle_name ; + ?last_name ; + ?label ; + ?type ; + ?internalID ; + ?ORCID ; + ?SCOPUSAuthorID ; + ?ResearcherID . + + ?positionURI + rdf:type ; + ?organizationUnitURI ; + ?positionName ; + ?positionType ; + ?startDate ; + ?endDate . + } WHERE { + ?resource_id rdf:type + OPTIONAL { ?resource_id ?first_name } + OPTIONAL { ?resource_id ?middle_name } + OPTIONAL { ?resource_id ?last_name } + OPTIONAL { ?resource_id ?label } + OPTIONAL { ?resource_id ?type } + OPTIONAL { ?resource_id ?internalID } + OPTIONAL { ?resource_id ?ORCID } + OPTIONAL { ?resource_id ?SCOPUSAuthorID } + OPTIONAL { ?resource_id ?ResearcherID } + OPTIONAL { + ?resource_id ?positionURI . + ?positionURI ?organizationUnitURI . + ?positionURI ?positionName . + ?positionURI ?positionType . + ?positionURI ?startDate . + ?positionURI ?endDate . + } + } + """ ; + dynapi:providesParameter person_parameter:person_graph ; + dynapi:requiresParameter person_parameter:resource_id ; + dynapi:hasModel dynapi_model:full_union . + +remove_from_graph:step + a dynapi:OperationalStep ; + dynapi:hasNextStep unload_from_graph:step ; + dynapi:hasOperation remove_from_graph:operation . + +remove_from_graph:operation + a dynapi:ModelWriter ; + dynapi:retractionModel person_parameter:person_graph ; + dynapi:targetModel dynapi_model:abox_assertions . + +unload_from_graph:step + a dynapi:OperationalStep ; + dynapi:hasOperation unload_from_graph:operation . + +unload_from_graph:operation + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter person_parameter:resource_id . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_increment_iterator.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_increment_iterator.n3 new file mode 100644 index 000000000..21bbe1324 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_increment_iterator.n3 @@ -0,0 +1,24 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix increment_iterator: . +@prefix iteration_parameter: . + + + a dynapi:Procedure ; + dynapi:providesParameter iteration_parameter:iteration_int_param ; + dynapi:hasFirstStep increment_iterator:step . + +increment_iterator:step + a dynapi:OperationalStep ; + dynapi:hasOperation increment_iterator:sumOperation . + +increment_iterator:sumOperation + a dynapi:SumOperation ; + dynapi:requiresParameter iteration_parameter:iteration_increment_param ; + dynapi:requiresParameter iteration_parameter:iteration_int_param ; + dynapi:providesParameter iteration_parameter:iteration_int_param . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_read_all_persons.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_read_all_persons.n3 new file mode 100644 index 000000000..5f89a5939 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_read_all_persons.n3 @@ -0,0 +1,111 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix dynapi_model: . +@prefix xsd: . +@prefix fetching_properties: . +@prefix response_parameter: . +@prefix request_parameter: . +@prefix statistics: . +@prefix whitelist_access: . + +############################################### +### READ (all) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching persons"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:providesParameter response_parameter:persons ; + dynapi:providesParameter response_parameter:count ; + dynapi:hasFirstStep fetching_properties:step . + +fetching_properties:step + a dynapi:OperationalStep ; + rdfs:label "fetch persons step"@en-US ; + dynapi:hasOperation fetching_properties:sparql_select_query ; + dynapi:hasNextStep statistics:step . + +fetching_properties:sparql_select_query + a dynapi:SparqlSelectQuery ; + rdfs:label "read persons sparql query"@en-US ; + dynapi:hasModel dynapi_model:full_union ; + dynapi:providesParameter response_parameter:persons ; + dynapi:requiresPlainParameter request_parameter:limit ; + dynapi:requiresPlainParameter request_parameter:offset ; + dynapi:requiresPlainParameter request_parameter:sortBy ; + dynapi:requiresPlainParameter request_parameter:order ; + dynapi:sparqlQueryText + """ + SELECT ?uri + (SAMPLE(?personType) as ?type) + (SAMPLE(?personlabel) as ?label) + (SAMPLE(?firstName) as ?first_name) + (SAMPLE(?middleName) as ?middle_name) + (SAMPLE(?lastName) as ?last_name) + (SAMPLE(?internalId) as ?internalID) + (SAMPLE(?orcid) as ?ORCID) + (SAMPLE(?scopus) as ?SCOPUSAuthorID) + (SAMPLE(?researcherId) as ?ResearcherID) + (CONCAT('[', + GROUP_CONCAT(DISTINCT + CONCAT( + '{"organizationUnitURI":"', IF(BOUND(?organizationUnitURI), STR(?organizationUnitURI), ''), + '", "organizationUnitName":"', IF(BOUND(?organisationUnitName), STR(?organisationUnitName), ''), + '", "positionName":"', IF(BOUND(?positionName), STR(?positionName), ''), + '", "positionType":"', IF(BOUND(?positionType), STR(?positionType), ''), + '", "startDate":"', IF(BOUND(?startDate), STR(?startDate), ''), + '", "endDate":"', IF(BOUND(?endDate), STR(?endDate), ''), + '"}' + ); separator=", "), + ']') + AS ?positions) + WHERE { + ?uri a . + OPTIONAL { ?uri ?personType } + OPTIONAL { ?uri ?firstName } + OPTIONAL { ?uri ?middleName } + OPTIONAL { ?uri ?lastName } + OPTIONAL { ?uri ?personlabel } + OPTIONAL { ?uri ?internalId } + OPTIONAL { ?uri ?orcid } + OPTIONAL { ?uri ?scopus } + OPTIONAL { ?uri ?researcherId } + OPTIONAL { ?uri ?positionURI } + OPTIONAL { + ?uri ?positionURI . + OPTIONAL { ?positionURI ?organizationUnitURI } + OPTIONAL { ?positionURI ?organisationUnitName } + OPTIONAL { ?positionURI ?positionName } + OPTIONAL { ?positionURI ?positionType } + OPTIONAL { ?positionURI ?startDate } + OPTIONAL { ?positionURI ?endDate } + } + } + GROUP BY ?uri + ORDER BY ?label + LIMIT ?limit OFFSET ?offset + """ . + +statistics:step + a dynapi:OperationalStep ; + rdfs:label "number of persons step "@en-US ; + dynapi:hasOperation statistics:sparql_query . + +statistics:sparql_query + a dynapi:SparqlSelectQuery ; + rdfs:label "number of persons sparql query 1"@en-US ; + dynapi:hasModel dynapi_model:full_union ; + dynapi:providesParameter response_parameter:count ; + dynapi:sparqlQueryText + """ + SELECT (count(distinct ?uri) as ?count) + WHERE + { + ?uri + } + """ . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_read_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_read_person.n3 new file mode 100644 index 000000000..a36e0060a --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_read_person.n3 @@ -0,0 +1,84 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix dynapi_model: . +@prefix xsd: . +@prefix fetching_properties: . +@prefix whitelist_access: . +@prefix response_parameter: . +@prefix request_parameter: . + +############################################### +### READ (one) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching a person"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:providesParameter response_parameter:persons ; + dynapi:hasFirstStep fetching_properties:step . + +fetching_properties:step + a dynapi:OperationalStep ; + rdfs:label "reading of a person"@en-US ; + dynapi:hasOperation fetching_properties:sparql_query . + +fetching_properties:sparql_query + a dynapi:SparqlSelectQuery ; + rdfs:label "read person sparql query 1"@en-US ; + dynapi:hasModel dynapi_model:full_union ; + dynapi:requiresParameter request_parameter:resource_id ; + dynapi:providesParameter response_parameter:persons ; + dynapi:sparqlQueryText + """ + SELECT ?uri (GROUP_CONCAT(DISTINCT ?personType; separator=" -> ") as ?type) + (SAMPLE(?personlabel) as ?label) + (SAMPLE(?firstName) as ?first_name) + (SAMPLE(?middleName) as ?middle_name) + (SAMPLE(?lastName) as ?last_name) + (SAMPLE(?internalId) as ?internalID) + (SAMPLE(?orcid) as ?ORCID) + (SAMPLE(?scopus) as ?SCOPUSAuthorID) + (SAMPLE(?researcherId) as ?ResearcherID) + (CONCAT('[', + GROUP_CONCAT(DISTINCT + CONCAT( + '{"organizationUnitURI":"', IF(BOUND(?organizationUnitURI), STR(?organizationUnitURI), ''), + '", "organizationUnitName":"', IF(BOUND(?organisationUnitName), STR(?organisationUnitName), ''), + '", "positionName":"', IF(BOUND(?positionName), STR(?positionName), ''), + '", "positionType":"', IF(BOUND(?positionType), STR(?positionType), ''), + '", "startDate":"', IF(BOUND(?startDate), STR(?startDate), ''), + '", "endDate":"', IF(BOUND(?endDate), STR(?endDate), ''), + '"}' + ); separator=", "), + ']') + AS ?positions) + WHERE { + ?uri a . + OPTIONAL { ?uri ?personType } + OPTIONAL { ?uri ?firstName } + OPTIONAL { ?uri ?middleName } + OPTIONAL { ?uri ?lastName } + OPTIONAL { ?uri ?personlabel } + OPTIONAL { ?uri ?internalId } + OPTIONAL { ?uri ?orcid } + OPTIONAL { ?uri ?scopus } + OPTIONAL { ?uri ?researcherId } + OPTIONAL { + ?uri ?positionURI . + OPTIONAL { ?positionURI ?organizationUnitURI } + OPTIONAL { ?positionURI ?organisationUnitName } + OPTIONAL { ?positionURI ?positionName } + OPTIONAL { ?positionURI ?positionType } + OPTIONAL { ?positionURI ?startDate } + OPTIONAL { ?positionURI ?endDate } + } + FILTER (?uri = ?resource_id) + } + GROUP BY ?uri + LIMIT 1 + """ . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_update_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_update_person.n3 new file mode 100644 index 000000000..ce4494146 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_update_person.n3 @@ -0,0 +1,280 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix dynapi_model: . +@prefix xsd: . +@prefix get_from_graph: . +@prefix remove_from_graph: . +@prefix unload_from_proc_pool: . +@prefix creation_properties: . +@prefix condition: . +@prefix execute_template: . +@prefix request_parameter: . +@prefix iteration_parameter: . +@prefix create_person_positions: . +@prefix whitelist_access: . + +############################################### +### UPDATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Updating a person"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:hasFirstStep get_from_graph:step . + +get_from_graph:step + a dynapi:OperationalStep ; + dynapi:hasNextStep remove_from_graph:step ; + dynapi:hasOperation . + +remove_from_graph:step + a dynapi:OperationalStep ; + dynapi:hasNextStep unload_from_proc_pool:step ; + dynapi:hasOperation remove_from_graph:operation . + +remove_from_graph:operation + a dynapi:ModelWriter ; + dynapi:retractionModel request_parameter:person_graph ; + dynapi:targetModel dynapi_model:abox_assertions . + +unload_from_proc_pool:step + a dynapi:OperationalStep ; + dynapi:hasNextStep creation_properties:step1 ; + dynapi:hasOperation unload_from_proc_pool:operation . + +unload_from_proc_pool:operation + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter request_parameter:resource_id . + +creation_properties:step1 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation execute_template:n3_template_subject ; + dynapi:hasNextStep creation_properties:conditional_for_step2 . + +creation_properties:conditional_for_step2 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step2 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step3 ; + dynapi:hasCondition condition:first_name_check . + +creation_properties:step2 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 2"@en-US ; + dynapi:hasOperation execute_template:n3_template_first_name ; + dynapi:hasNextStep creation_properties:conditional_for_step3 . + +creation_properties:conditional_for_step3 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person middle name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step3 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step4 ; + dynapi:hasCondition condition:middle_name_check . + +creation_properties:step3 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 3"@en-US ; + dynapi:hasOperation execute_template:n3_template_middle_name ; + dynapi:hasNextStep creation_properties:conditional_for_step4 . + +creation_properties:conditional_for_step4 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person last name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step4 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step5 ; + dynapi:hasCondition condition:last_name_check . + +creation_properties:step4 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 4"@en-US ; + dynapi:hasOperation execute_template:n3_template_last_name ; + dynapi:hasNextStep creation_properties:conditional_for_step5 . + +creation_properties:conditional_for_step5 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person type check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step5 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step6 ; + dynapi:hasCondition condition:type_check . + +creation_properties:step5 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 5"@en-US ; + dynapi:hasOperation execute_template:n3_template_type ; + dynapi:hasNextStep creation_properties:conditional_for_step6 . + +creation_properties:conditional_for_step6 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person internal id check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step6 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step7 ; + dynapi:hasCondition condition:internal_id_check . + +creation_properties:step6 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 6"@en-US ; + dynapi:hasOperation execute_template:n3_template_internal_id ; + dynapi:hasNextStep creation_properties:conditional_for_step7 . + +creation_properties:conditional_for_step7 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person ORCID check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step7 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step8 ; + dynapi:hasCondition condition:orcid_check . + +creation_properties:step7 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 7"@en-US ; + dynapi:hasOperation execute_template:n3_template_orcid ; + dynapi:hasNextStep creation_properties:conditional_for_step8 . + +creation_properties:conditional_for_step8 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step8 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step9 ; + dynapi:hasCondition condition:scopus_author_id_check . + +creation_properties:step8 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 8"@en-US ; + dynapi:hasOperation execute_template:n3_template_scopus_id ; + dynapi:hasNextStep creation_properties:conditional_for_step9 . + +creation_properties:conditional_for_step9 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step9 ; + dynapi:nextIfNotSatisfied creation_properties:conditional_for_step10 ; + dynapi:hasCondition condition:researcher_id_check . + +creation_properties:step9 + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 9"@en-US ; + dynapi:hasOperation execute_template:n3_template_researcher_id ; + dynapi:hasNextStep creation_properties:conditional_for_step10 . + +creation_properties:conditional_for_step10 + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person positions check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step10 ; + dynapi:hasCondition condition:positions_check . + +creation_properties:substitution + a dynapi:ParameterSubstitution ; + dynapi:substitutionSource request_parameter:resource_id ; + dynapi:substitutionTarget request_parameter:current_uri_persisted . + +creation_properties:step10 + a dynapi:OperationalStep ; + dynapi:hasParameterSubstitution creation_properties:substitution ; + dynapi:hasOperation create_person_positions:loop ; + rdfs:label "Create provided person positions"@en-US . + +create_person_positions:loop + a dynapi:LoopOperation ; + dynapi:inputDescriptor ; + dynapi:conditionDescriptor ; + + dynapi:outputDescriptor ; + dynapi:executableDescriptor create_person_positions:executable_descriptor ; + + dynapi:internalParameter iteration_parameter:iteration_int_param ; + + dynapi:internalParameter iteration_parameter:current_positions_item ; + dynapi:providesParameter iteration_parameter:current_positions_item . + +create_person_positions:executable_descriptor + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter iteration_parameter:current_step_uri ; + dynapi:requiresParameter request_parameter:current_uri_persisted ; + dynapi:requiresParameter iteration_parameter:current_positions_item ; + dynapi:call . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY UPDATE +############################################### + +execute_template:n3_template_subject + a dynapi:N3Template ; + rdfs:label "update person N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter request_parameter:resource_id ; + dynapi:requiresParameter request_parameter:label ; + dynapi:N3TextAdditions + """ + ?resource_id ; + ?label . + """ . + +execute_template:n3_template_first_name + a dynapi:N3Template ; + rdfs:label "update person first name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter request_parameter:resource_id ; + dynapi:requiresParameter request_parameter:first_name ; + dynapi:N3TextAdditions "?resource_id ?first_name . " . + +execute_template:n3_template_middle_name + a dynapi:N3Template ; + rdfs:label "update person middle name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter request_parameter:resource_id ; + dynapi:requiresParameter request_parameter:middle_name ; + dynapi:N3TextAdditions "?resource_id ?middle_name . " . + +execute_template:n3_template_last_name + a dynapi:N3Template ; + rdfs:label "update person last name N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter request_parameter:resource_id ; + dynapi:requiresParameter request_parameter:last_name ; + dynapi:N3TextAdditions "?resource_id ?last_name . " . + +execute_template:n3_template_type + a dynapi:N3Template ; + rdfs:label "update person type N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter request_parameter:resource_id ; + dynapi:requiresParameter request_parameter:type ; + dynapi:N3TextAdditions "?resource_id ?type . " . + +execute_template:n3_template_internal_id + a dynapi:N3Template ; + rdfs:label "update person internal id N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter request_parameter:resource_id ; + dynapi:requiresParameter request_parameter:internalID ; + dynapi:N3TextAdditions "?resource_id ?internalID . " . + +execute_template:n3_template_orcid + a dynapi:N3Template ; + rdfs:label "update person ORCID N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter request_parameter:resource_id ; + dynapi:requiresParameter request_parameter:ORCID ; + dynapi:N3TextAdditions "?resource_id ?ORCID . " . + +execute_template:n3_template_scopus_id + a dynapi:N3Template ; + rdfs:label "update person SCOPUS author ID N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter request_parameter:resource_id ; + dynapi:requiresParameter request_parameter:SCOPUSAuthorID ; + dynapi:N3TextAdditions "?resource_id ?SCOPUSAuthorID . " . + +execute_template:n3_template_researcher_id + a dynapi:N3Template ; + rdfs:label "update person researcher ID N3 Template"@en-US ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter request_parameter:resource_id ; + dynapi:requiresParameter request_parameter:ResearcherID ; + dynapi:N3TextAdditions "?resource_id ?ResearcherID . " . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_API.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_API.n3 new file mode 100644 index 000000000..972bf9e2f --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_API.n3 @@ -0,0 +1,15 @@ +@prefix rdfs: . +@prefix dynapi: . + + + + + a dynapi:ResourceAPI ; + rdfs:label "person resource API 1"@en-US ; + dynapi:name "person" ; + dynapi:minAPIVersion "0.1.0" ; + dynapi:onPost ; + dynapi:onGetAll ; + dynapi:onGet ; + dynapi:onPut ; + dynapi:onDelete . \ No newline at end of file diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_parameters.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_parameters.n3 new file mode 100644 index 000000000..5c90f8522 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_parameters.n3 @@ -0,0 +1,335 @@ +@prefix xsd: . +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix dynapi_type: . +@prefix xsd: . +@prefix response_parameter: . +@prefix iteration_parameter: . +@prefix request_parameter: . +@prefix position_request_param: . + +############################################### +### PARAMETERS +############################################### + +##################### +## Person response ## +##################### + +response_parameter:persons + a dynapi:Parameter ; + rdfs:label "persons"@en-US ; + dynapi:name "persons" ; + dynapi:description "List of available persons and statistics (number)" ; + dynapi:hasType dynapi_type:JsonContainerArray . + +response_parameter:count + a dynapi:Parameter ; + rdfs:label "Number of fetched persons"@en-US ; + dynapi:name "count" ; + dynapi:hasType dynapi_type:JsonContainer . + +###################### +## Iteration params ## +###################### + +iteration_parameter:iteration_int_param + a dynapi:Parameter ; + dynapi:name "iteration_param" ; + dynapi:defaultValue "0" ; + dynapi:hasType dynapi_type:integer . + +iteration_parameter:iteration_increment_param + a dynapi:Parameter ; + dynapi:name "int_1" ; + dynapi:defaultValue "1" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:integer . + +iteration_parameter:default_condition_0_int + a dynapi:Parameter ; + dynapi:name "condition_result" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:integer . + +iteration_parameter:expected_int_result_1 + a dynapi:Parameter ; + dynapi:name "condition_result" ; + dynapi:defaultValue "1" ; + dynapi:hasType dynapi_type:integer . + +iteration_parameter:add_int_1_param + a dynapi:Parameter ; + dynapi:name "int_1" ; + dynapi:defaultValue "1" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:integer . + +iteration_parameter:current_step_uri + a dynapi:Parameter ; + dynapi:name "current_step_uri" ; + dynapi:defaultValue "https://vivoweb.org/procedure/person_position/,java_uuid_number" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:generated-uri . + +iteration_parameter:current_positions_item + a dynapi:Parameter ; + dynapi:name "item" ; + dynapi:hasType dynapi_type:JsonContainer . + +##################### +## Creation fields ## +##################### + +request_parameter:current_uri_persisted + a dynapi:Parameter ; + dynapi:name "current_uri_persisted" ; + dynapi:hasType dynapi_type:uri . + +request_parameter:uri + a dynapi:Parameter ; + dynapi:name "uri" ; + dynapi:defaultValue "http://xmlns.com/foaf/0.1/Person#,java_uuid_number" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:generated-uri . + +request_parameter:label + a dynapi:Parameter ; + dynapi:name "label" ; + dynapi:hasType dynapi_type:string-literal . + +request_parameter:first_name + a dynapi:Parameter ; + dynapi:name "first_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameter:middle_name + a dynapi:Parameter ; + dynapi:name "middle_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameter:last_name + a dynapi:Parameter ; + dynapi:name "last_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameter:type + a dynapi:Parameter ; + dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:uri . + +request_parameter:positions + a dynapi:Parameter ; + dynapi:name "positions" ; + dynapi:defaultValue "[]" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:JsonContainerArray . + +request_parameter:internalID + a dynapi:Parameter ; + dynapi:name "internalID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameter:ORCID + a dynapi:Parameter ; + dynapi:name "ORCID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameter:SCOPUSAuthorID + a dynapi:Parameter ; + dynapi:name "SCOPUSAuthorID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +request_parameter:ResearcherID + a dynapi:Parameter ; + dynapi:name "ResearcherID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +######################### +## Read request fields ## +######################### + +request_parameter:resource_id + a dynapi:Parameter ; + dynapi:name "resource_id" ; + dynapi:hasType dynapi_type:uri ; + rdfs:label "resource uri"@en-US . + +request_parameter:total + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType dynapi_type:integer ; + rdfs:label "total"@en-US . + +request_parameter:limit + a dynapi:parameter ; + dynapi:name "limit" ; + dynapi:defaultValue "20" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:integer ; + rdfs:label "limit"@en-US . + +request_parameter:offset + a dynapi:parameter ; + dynapi:name "offset" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:integer ; + rdfs:label "offset"@en-US . + +request_parameter:sortBy + a dynapi:parameter ; + dynapi:name "sortBy" ; + dynapi:defaultValue "label" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string ; + rdfs:label "sortBy"@en-US . + +request_parameter:order + a dynapi:parameter ; + dynapi:name "order" ; + dynapi:defaultValue "ASC" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string ; + rdfs:label "order"@en-US . + +########################### +## Delete request fields ## +########################### + +request_parameter:person_graph + a dynapi:Model ; + dynapi:name "person_graph" ; + dynapi:hasType dynapi_type:model . + +############################################### +### POSITION FIELDS +############################################### + +# Internal + +position_request_param:organizationUnitURI_key + a dynapi:Parameter ; + dynapi:name "organizationUnitURI_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "organizationUnitURI" ; + dynapi:hasType dynapi_type:string . + +position_request_param:organizationUnitName_key + a dynapi:Parameter ; + dynapi:name "organizationUnitName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "organizationUnitName" ; + dynapi:hasType dynapi_type:string . + +position_request_param:positionName_key + a dynapi:Parameter ; + dynapi:name "positionName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "positionName" ; + dynapi:hasType dynapi_type:string . + +position_request_param:positionType_key + a dynapi:Parameter ; + dynapi:name "positionType_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "positionType" ; + dynapi:hasType dynapi_type:string . + +position_request_param:startDate_key + a dynapi:Parameter ; + dynapi:name "startDate_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "startDate" ; + dynapi:hasType dynapi_type:string . + +position_request_param:endDate_key + a dynapi:Parameter ; + dynapi:name "endDate_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "endDate" ; + dynapi:hasType dynapi_type:string . + +# Provided + +position_request_param:organizationUnitURI + a dynapi:Parameter ; + dynapi:name "organizationUnitURI" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:uri . + +position_request_param:organizationUnitName + a dynapi:Parameter ; + dynapi:name "organizationUnitName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +position_request_param:positionName + a dynapi:Parameter ; + dynapi:name "positionName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +position_request_param:positionType + a dynapi:Parameter ; + dynapi:name "positionType" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +position_request_param:startDate + a dynapi:Parameter ; + dynapi:name "startDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + +position_request_param:endDate + a dynapi:Parameter ; + dynapi:name "endDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_utils.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_utils.n3 new file mode 100644 index 000000000..ff6757bfb --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_utils.n3 @@ -0,0 +1,145 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix position_parameter: . +@prefix position_condition: . +@prefix iteration_parameter: . +@prefix whitelist_access: . +@prefix person_condition: . +@prefix person_parameter: . +@prefix unpacking_properties: . + +########################## +## Unpacking operations ## +########################## + +unpacking_properties:get_organisation_unit_uri + a dynapi:ContainerQuery ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:organizationUnitURI_key ; + dynapi:providesParameter position_parameter:organizationUnitURI . + +unpacking_properties:get_organisation_unit_name + a dynapi:ContainerQuery ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:organizationUnitName_key ; + dynapi:providesParameter position_parameter:organizationUnitName . + +unpacking_properties:get_position_name + a dynapi:ContainerQuery ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:positionName_key ; + dynapi:providesParameter position_parameter:positionName . + +unpacking_properties:get_position_type + a dynapi:ContainerQuery ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:positionType_key ; + dynapi:providesParameter position_parameter:positionType . + +unpacking_properties:get_start_date + a dynapi:ContainerQuery ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:startDate_key ; + dynapi:providesParameter position_parameter:startDate . + +unpacking_properties:get_end_date + a dynapi:ContainerQuery ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:endDate_key ; + dynapi:providesParameter position_parameter:endDate . + +############################################### +### PARAMETER CHECKS +############################################### + +# Person attributes + +person_condition:first_name_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person first name is defined"@en-US ; + dynapi:requiresParameter person_parameter:first_name . + +person_condition:middle_name_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person middle name is defined"@en-US ; + dynapi:requiresParameter person_parameter:middle_name . + +person_condition:last_name_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person last name is defined"@en-US ; + dynapi:requiresParameter person_parameter:last_name . + +person_condition:type_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person type is defined"@en-US ; + dynapi:requiresParameter person_parameter:type . + +person_condition:internal_id_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person internal ID is defined"@en-US ; + dynapi:requiresParameter person_parameter:internalID . + +person_condition:orcid_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person ORCID is defined"@en-US ; + dynapi:requiresParameter person_parameter:ORCID . + +person_condition:scopus_author_id_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person SCOPUS author id is defined"@en-US ; + dynapi:requiresParameter person_parameter:SCOPUSAuthorID . + +person_condition:researcher_id_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person researcher ID is defined"@en-US ; + dynapi:requiresParameter person_parameter:ResearcherID . + +person_condition:positions_check + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person positions are defined"@en-US ; + dynapi:requiresParameter person_parameter:positions . + +# Person position container keys + +position_condition:contains_organisation_unit_uri_key + a dynapi:ConditionContainerContains ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:organizationUnitURI_key . + +position_condition:contains_organisation_unit_name_key + a dynapi:ConditionContainerContains ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:organizationUnitName_key . + +position_condition:contains_position_name_key + a dynapi:ConditionContainerContains ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:positionName_key . + +position_condition:contains_position_type_key + a dynapi:ConditionContainerContains ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:positionType_key . + +position_condition:contains_start_date_key + a dynapi:ConditionContainerContains ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:startDate_key . + +position_condition:contains_end_date_key + a dynapi:ConditionContainerContains ; + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:endDate_key . + +############################################### +### ACCESS CONTROL +############################################### + +whitelist_access:admin + a dynapi:GroupAccessWhitelist ; + dynapi:userGroup . \ No newline at end of file diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_add_person_position.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_add_person_position.n3 new file mode 100644 index 000000000..5d496b627 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_add_person_position.n3 @@ -0,0 +1,136 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix dynapi_model: . +@prefix xsd: . +@prefix add_person_position: . +@prefix execute_template: . +@prefix position_parameter: . +@prefix person_parameter: . +@prefix iteration_parameter: . +@prefix condition: . +@prefix unpacking_properties: . + +############################################################ +#Add person position + + + a dynapi:Procedure ; + dynapi:hasFirstStep add_person_position:contains_organisation_unit_uri_key . + +add_person_position:contains_organisation_unit_uri_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied add_person_position:get_organisation_unit_uri ; + dynapi:nextIfNotSatisfied add_person_position:contains_organisation_unit_name_key ; + dynapi:hasCondition condition:contains_organisation_unit_uri_key . + +add_person_position:get_organisation_unit_uri + a dynapi:OperationalStep ; + dynapi:hasNextStep add_person_position:contains_organisation_unit_name_key ; + dynapi:hasOperation unpacking_properties:get_organisation_unit_uri . + +add_person_position:contains_organisation_unit_name_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied add_person_position:get_organisation_unit_name ; + dynapi:nextIfNotSatisfied add_person_position:contains_position_name_key ; + dynapi:hasCondition condition:contains_organisation_unit_name_key . + +add_person_position:get_organisation_unit_name + a dynapi:OperationalStep ; + dynapi:hasNextStep add_person_position:contains_position_name_key ; + dynapi:hasOperation unpacking_properties:get_organisation_unit_name . + +add_person_position:contains_position_name_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied add_person_position:get_position_name ; + dynapi:nextIfNotSatisfied add_person_position:contains_position_type_key ; + dynapi:hasCondition condition:contains_position_name_key . + +add_person_position:get_position_name + a dynapi:OperationalStep ; + dynapi:hasNextStep add_person_position:contains_position_type_key ; + dynapi:hasOperation unpacking_properties:get_position_name . + +add_person_position:contains_position_type_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied add_person_position:get_position_type ; + dynapi:nextIfNotSatisfied add_person_position:contains_start_date_key ; + dynapi:hasCondition condition:contains_position_type_key . + +add_person_position:get_position_type + a dynapi:OperationalStep ; + dynapi:hasNextStep add_person_position:contains_start_date_key ; + dynapi:hasOperation unpacking_properties:get_position_type . + +add_person_position:contains_start_date_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied add_person_position:get_start_date ; + dynapi:nextIfNotSatisfied add_person_position:contains_end_date_key ; + dynapi:hasCondition condition:contains_start_date_key . + +add_person_position:get_start_date + a dynapi:OperationalStep ; + dynapi:hasNextStep add_person_position:contains_end_date_key ; + dynapi:hasOperation unpacking_properties:get_start_date . + +add_person_position:contains_end_date_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied add_person_position:get_end_date ; + dynapi:nextIfNotSatisfied add_person_position:position_construct_query_fill_in ; + dynapi:hasCondition condition:contains_end_date_key . + +add_person_position:get_end_date + a dynapi:OperationalStep ; + dynapi:hasNextStep add_person_position:position_construct_query_fill_in ; + dynapi:hasOperation unpacking_properties:get_end_date . + +add_person_position:position_construct_query_fill_in + a dynapi:OperationalStep ; + dynapi:hasNextStep add_person_position:bind_position_construct_query ; + dynapi:hasOperation execute_template:position_construct_query_fill_in . + +execute_template:position_construct_query_fill_in + a dynapi:N3Template ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter position_parameter:organizationUnitURI ; + dynapi:requiresParameter position_parameter:organizationUnitName ; + dynapi:requiresParameter position_parameter:positionName ; + dynapi:requiresParameter position_parameter:positionType ; + dynapi:requiresParameter position_parameter:startDate ; + dynapi:requiresParameter position_parameter:endDate ; + dynapi:requiresParameter iteration_parameter:current_step_uri ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?current_step_uri ; + ?positionType ; + ?positionName ; + ?organizationUnitName ; + ?organizationUnitURI ; + ?startDate ; + ?endDate . + + """ . + +add_person_position:bind_position_construct_query + a dynapi:OperationalStep ; + dynapi:hasOperation execute_template:bind_position_construct_query . + +execute_template:bind_position_construct_query + a dynapi:N3Template ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:current_uri_persisted ; + dynapi:requiresParameter iteration_parameter:current_step_uri ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?current_uri_persisted ?current_step_uri . + + """ . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_contains_position_item.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_contains_position_item.n3 new file mode 100644 index 000000000..2a9db42e6 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_contains_position_item.n3 @@ -0,0 +1,38 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix contains_position_item: . +@prefix iteration_parameter: . +@prefix request_parameter: . + +############################################################ +#Condition procedure + + + a dynapi:Procedure ; + dynapi:providesParameter iteration_parameter:default_condition_0_int ; + dynapi:hasFirstStep contains_position_item:conditional_step . + +contains_position_item:conditional_step + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied contains_position_item:condition_satisfied_step ; + dynapi:hasCondition contains_position_item:condition_container_contains . + +contains_position_item:condition_satisfied_step + a dynapi:OperationalStep ; + dynapi:hasOperation contains_position_item:addOperation . + +contains_position_item:addOperation + a dynapi:SumOperation ; + dynapi:requiresParameter iteration_parameter:add_int_1_param ; + dynapi:requiresParameter iteration_parameter:default_condition_0_int ; + dynapi:providesParameter iteration_parameter:default_condition_0_int . + +contains_position_item:condition_container_contains + a dynapi:ConditionContainerContains ; + dynapi:targetContainer request_parameter:positions ; + dynapi:requiresParameter iteration_parameter:iteration_int_param . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_get_position_from_container.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_get_position_from_container.n3 new file mode 100644 index 000000000..1f51e6691 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_get_position_from_container.n3 @@ -0,0 +1,28 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix iteration_parameter: . +@prefix request_parameter: . +@prefix get_position_from_container: . + +############################################################ +#Get position from a container + + + a dynapi:Procedure ; + dynapi:hasFirstStep get_position_from_container:step ; + dynapi:providesParameter iteration_parameter:current_positions_item . + +get_position_from_container:step + a dynapi:OperationalStep ; + dynapi:hasOperation get_position_from_container:operation . + +get_position_from_container:operation + a dynapi:ContainerQuery ; + dynapi:providesParameter iteration_parameter:current_positions_item ; + dynapi:targetContainer request_parameter:positions ; + dynapi:requiresParameter iteration_parameter:iteration_int_param . \ No newline at end of file diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_update_person_position.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_update_person_position.n3 new file mode 100644 index 000000000..4bc860c53 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_update_person_position.n3 @@ -0,0 +1,92 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix update_person_position: . +@prefix condition: . +@prefix unpacking_properties: . + +############################################################ +#Update person position + + + a dynapi:Procedure ; + dynapi:hasFirstStep update_person_position:contains_organisation_unit_uri_key . + +update_person_position:contains_organisation_unit_uri_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied update_person_position:get_organisation_unit_uri ; + dynapi:nextIfNotSatisfied update_person_position:contains_organisation_unit_name_key ; + dynapi:hasCondition condition:contains_organisation_unit_uri_key . + +update_person_position:get_organisation_unit_uri + a dynapi:OperationalStep ; + dynapi:hasNextStep update_person_position:contains_organisation_unit_name_key ; + dynapi:hasOperation unpacking_properties:get_organisation_unit_uri . + +update_person_position:contains_organisation_unit_name_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied update_person_position:get_organisation_unit_name ; + dynapi:nextIfNotSatisfied update_person_position:contains_position_name_key ; + dynapi:hasCondition condition:contains_organisation_unit_name_key . + +update_person_position:get_organisation_unit_name + a dynapi:OperationalStep ; + dynapi:hasNextStep update_person_position:contains_position_name_key ; + dynapi:hasOperation unpacking_properties:get_organisation_unit_name . + +update_person_position:contains_position_name_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied update_person_position:get_position_name ; + dynapi:nextIfNotSatisfied update_person_position:contains_position_type_key ; + dynapi:hasCondition condition:contains_position_name_key . + +update_person_position:get_position_name + a dynapi:OperationalStep ; + dynapi:hasNextStep update_person_position:contains_position_type_key ; + dynapi:hasOperation unpacking_properties:get_position_name . + +update_person_position:contains_position_type_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied update_person_position:get_position_type ; + dynapi:nextIfNotSatisfied update_person_position:contains_start_date_key ; + dynapi:hasCondition condition:contains_position_type_key . + +update_person_position:get_position_type + a dynapi:OperationalStep ; + dynapi:hasNextStep update_person_position:contains_start_date_key ; + dynapi:hasOperation unpacking_properties:get_position_type . + +update_person_position:contains_start_date_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied update_person_position:get_start_date ; + dynapi:nextIfNotSatisfied update_person_position:contains_end_date_key ; + dynapi:hasCondition condition:contains_start_date_key . + +update_person_position:get_start_date + a dynapi:OperationalStep ; + dynapi:hasNextStep update_person_position:contains_end_date_key ; + dynapi:hasOperation unpacking_properties:get_start_date . + +update_person_position:contains_end_date_key + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied update_person_position:get_end_date ; + dynapi:nextIfNotSatisfied update_person_position:position_construct_query_fill_in ; + dynapi:hasCondition condition:contains_end_date_key . + +update_person_position:get_end_date + a dynapi:OperationalStep ; + dynapi:hasNextStep update_person_position:position_construct_query_fill_in ; + dynapi:hasOperation unpacking_properties:get_end_date . + +update_person_position:position_construct_query_fill_in + a dynapi:OperationalStep ; + dynapi:hasNextStep update_person_position:bind_position_construct_query ; + dynapi:hasOperation . + +update_person_position:bind_position_construct_query + a dynapi:OperationalStep ; + dynapi:hasOperation .