From 4a2bf0077757bd2be1924c36cd3362add39a0c43 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 31 May 2023 11:59:01 +0200 Subject: [PATCH 01/38] Added n3 files for person crud operations. --- .../endpoint_procedure_CRUD_person.n3 | 373 ++++++++++++++++++ .../endpoint_resource_CRUD_person.n3 | 15 + 2 files changed, 388 insertions(+) create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 new file mode 100644 index 000000000..55dedaeb6 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -0,0 +1,373 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################### +### CREATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Create a person"@en-US ; + dynapi:hasFirstStep ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + rdfs:label "Creation of a person by using N3 operation"@en-US ; + dynapi:hasOperation . + + + a dynapi:N3Template ; + rdfs:label "Create person N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?person_uri + ; + ?person_given_name ; + ?person_middle_name ; + ?person_last_name ; + ?person_type ; + ?person_internal_id ; + ?person_orcid ; + ?person_scopus_author_id; + ?person_researcher_id . + """ . + +############################################### +### READ (all) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching persons"@en-US ; + dynapi:providesParameter ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "fetch persons step"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read persons sparql query"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:sparqlQueryText + """ + SELECT ?uri ?person_given_name ?person_middle_name ?person_last_name ?person_type ?person_internal_id ?person_orcid ?person_scopus_author_id ?person_researcher_id + WHERE + { + ?uri + OPTIONAL { ?uri ?person_given_name } + OPTIONAL { ?uri ?person_middle_name } + OPTIONAL { ?uri ?person_last_name } + OPTIONAL { ?uri ?person_type } + OPTIONAL { ?uri ?person_internal_id } + OPTIONAL { ?uri ?person_orcid } + OPTIONAL { ?uri ?person_scopus_author_id } + OPTIONAL { ?uri ?person_researcher_id } + } + ORDER BY ?order(??sortBy) + LIMIT ?limit OFFSET ?offset + """ . + + + a dynapi:OperationalStep ; + rdfs:label "number of persons step "@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "number of persons sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; + dynapi:sparqlQueryText + """ + SELECT (count(distinct ?uri) as ?total) + WHERE + { + ?uri + } + """ . + +############################################### +### READ (one) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching a person"@en-US ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "reading of a person"@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read persons sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:providesParameter ; + dynapi:sparqlQueryText + """ + SELECT ?uri ?label + WHERE + { + ?uri + OPTIONAL { ?uri ?person_given_name } + OPTIONAL { ?uri ?person_middle_name } + OPTIONAL { ?uri ?person_last_name } + OPTIONAL { ?uri ?person_type } + OPTIONAL { ?uri ?person_internal_id } + OPTIONAL { ?uri ?person_orcid } + OPTIONAL { ?uri ?person_scopus_author_id } + OPTIONAL { ?uri ?person_researcher_id } + FILTER (?uri = ?resource_id) + } + """ . + +############################################### +### UPDATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Updating a person"@en-US ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "Fetching of a person data for deleting"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:OperationalStep ; + rdfs:label "Deleting of a person"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person "@en-US ; + dynapi:hasOperation . + +############################################### +### DELETE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Removing of a person"@en-US ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "Fetching of a person data for deleting"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "Read persons sparql query"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:providesParameter ; + dynapi:sparqlQueryText + """ + SELECT ?uri ?label + WHERE + { + ?uri + OPTIONAL { ?uri ?person_given_name } + OPTIONAL { ?uri ?person_middle_name } + OPTIONAL { ?uri ?person_last_name } + OPTIONAL { ?uri ?person_type } + OPTIONAL { ?uri ?person_internal_id } + OPTIONAL { ?uri ?person_orcid } + OPTIONAL { ?uri ?person_scopus_author_id } + OPTIONAL { ?uri ?person_researcher_id } + FILTER (?uri = ?resource_id) + } + """ . + + + a dynapi:OperationalStep ; + rdfs:label "Deleting of a person"@en-US ; + dynapi:hasOperation . + + + a dynapi:N3Template ; + rdfs:label "delete person label N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextRetractions + """ + ?person_for_deleting.0.uri + ?person_for_deleting.0.label ; + . + """ . + +############################################### +### PARAMETERS +############################################### + +##################### +## Person response ## +##################### + + + a dynapi:Parameter ; + rdfs:label "persons"@en-US ; + dynapi:name "result" ; + dynapi:description "List of available persons and statistics (number)" ; + dynapi:hasType . + + + a dynapi:Parameter ; + rdfs:label "Number of fetched persons"@en-US ; + dynapi:name "count" ; + dynapi:hasType . + +####################### +## Delete parameters ## +####################### + + + a dynapi:Parameter ; + rdfs:label "person for deleting"@en-US ; + dynapi:name "stateOrProvinceForDeleting" ; + dynapi:description "List of available persons" ; + dynapi:hasType . + +##################### +## Creation fields ## +##################### + + + a dynapi:Parameter ; + dynapi:name "person_uri" ; + dynapi:defaultValue "http://xmlns.com/foaf/0.1/Person#,java_uuid_number" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "person_given_name" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "person_middle_name" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "person_last_name" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "person_type" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "person_positions" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "person_internal_id" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "person_orcid" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "person_scopus_author_id" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "person_researcher_id" ; + dynapi:hasType . + +######################### +## Read request fields ## +######################### + + + a dynapi:parameter ; + dynapi:name "resource_id" ; + dynapi:hasType ; + rdfs:label "resource uri"@en-US . + + + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType ; + rdfs:label "total"@en-US . + + + a dynapi:parameter ; + dynapi:name "limit" ; + dynapi:defaultValue "20" ; + dynapi:hasType ; + rdfs:label "limit"@en-US . + + + a dynapi:parameter ; + dynapi:name "offset" ; + dynapi:defaultValue "0" ; + dynapi:hasType ; + rdfs:label "offset"@en-US . + + + a dynapi:parameter ; + dynapi:name "sortBy" ; + dynapi:defaultValue "label" ; + dynapi:hasType ; + rdfs:label "sortBy"@en-US . + + + a dynapi:parameter ; + dynapi:name "order" ; + dynapi:defaultValue "ASC" ; + dynapi:hasType ; + rdfs:label "order"@en-US . + + + a dynapi:Model ; + dynapi:name "http://xmlns.com/foaf/0.1/Person" ; + rdfs:label "persons model"@en-US ; + dynapi:hasType . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 new file mode 100644 index 000000000..a6a700c3b --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.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 "1.0.0" ; + dynapi:onPost ; + dynapi:onGetAll ; + dynapi:onGet ; + dynapi:onPut ; + dynapi:onDelete . \ No newline at end of file From 07b2bd28af85f231a76ffb46e9f53f26fbec0b3a Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 1 Jun 2023 11:56:09 +0200 Subject: [PATCH 02/38] Updated RDF. --- .../endpoint_procedure_CRUD_person.n3 | 133 +++++++++--------- 1 file changed, 70 insertions(+), 63 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 55dedaeb6..5dd41f26e 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -26,27 +26,27 @@ rdfs:label "Create person N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions """ ?person_uri ; - ?person_given_name ; - ?person_middle_name ; - ?person_last_name ; - ?person_type ; - ?person_internal_id ; - ?person_orcid ; - ?person_scopus_author_id; - ?person_researcher_id . + ?first_name ; + ?middle_name ; + ?last_name ; + ?type ; + ?internalID ; + ?ORCID ; + ?SCOPUSAuthorID; + ?ResearcherID . """ . ############################################### @@ -77,18 +77,18 @@ dynapi:requiresPlainParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?person_given_name ?person_middle_name ?person_last_name ?person_type ?person_internal_id ?person_orcid ?person_scopus_author_id ?person_researcher_id + SELECT ?uri ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID WHERE { ?uri - OPTIONAL { ?uri ?person_given_name } - OPTIONAL { ?uri ?person_middle_name } - OPTIONAL { ?uri ?person_last_name } - OPTIONAL { ?uri ?person_type } - OPTIONAL { ?uri ?person_internal_id } - OPTIONAL { ?uri ?person_orcid } - OPTIONAL { ?uri ?person_scopus_author_id } - OPTIONAL { ?uri ?person_researcher_id } + OPTIONAL { ?uri ?first_name } + OPTIONAL { ?uri ?middle_name } + OPTIONAL { ?uri ?last_name } + OPTIONAL { ?uri ?type } + OPTIONAL { ?uri ?internalID } + OPTIONAL { ?uri ?ORCID } + OPTIONAL { ?uri ?SCOPUSAuthorID } + OPTIONAL { ?uri ?ResearcherID } } ORDER BY ?order(??sortBy) LIMIT ?limit OFFSET ?offset @@ -136,18 +136,18 @@ dynapi:providesParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?label + SELECT ?uri ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID WHERE { ?uri - OPTIONAL { ?uri ?person_given_name } - OPTIONAL { ?uri ?person_middle_name } - OPTIONAL { ?uri ?person_last_name } - OPTIONAL { ?uri ?person_type } - OPTIONAL { ?uri ?person_internal_id } - OPTIONAL { ?uri ?person_orcid } - OPTIONAL { ?uri ?person_scopus_author_id } - OPTIONAL { ?uri ?person_researcher_id } + OPTIONAL { ?uri ?first_name } + OPTIONAL { ?uri ?middle_name } + OPTIONAL { ?uri ?last_name } + OPTIONAL { ?uri ?type } + OPTIONAL { ?uri ?internalID } + OPTIONAL { ?uri ?ORCID } + OPTIONAL { ?uri ?SCOPUSAuthorID } + OPTIONAL { ?uri ?ResearcherID } FILTER (?uri = ?resource_id) } """ . @@ -201,18 +201,18 @@ dynapi:providesParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?label + SELECT ?uri ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID WHERE { ?uri - OPTIONAL { ?uri ?person_given_name } - OPTIONAL { ?uri ?person_middle_name } - OPTIONAL { ?uri ?person_last_name } - OPTIONAL { ?uri ?person_type } - OPTIONAL { ?uri ?person_internal_id } - OPTIONAL { ?uri ?person_orcid } - OPTIONAL { ?uri ?person_scopus_author_id } - OPTIONAL { ?uri ?person_researcher_id } + OPTIONAL { ?uri ?first_name } + OPTIONAL { ?uri ?middle_name } + OPTIONAL { ?uri ?last_name } + OPTIONAL { ?uri ?type } + OPTIONAL { ?uri ?internalID } + OPTIONAL { ?uri ?ORCID } + OPTIONAL { ?uri ?SCOPUSAuthorID } + OPTIONAL { ?uri ?ResearcherID } FILTER (?uri = ?resource_id) } """ . @@ -230,7 +230,14 @@ dynapi:N3TextRetractions """ ?person_for_deleting.0.uri - ?person_for_deleting.0.label ; + ?person_for_deleting.0.type ; + ?person_for_deleting.0.first_name ; + ?person_for_deleting.0.middle_name ; + ?person_for_deleting.0.last_name ; + ?person_for_deleting.0.internalID ; + ?person_for_deleting.0.ORCID ; + ?person_for_deleting.0.SCOPUSAuthorID ; + ?person_for_deleting.0.ResearcherID ; . """ . @@ -277,49 +284,49 @@ dynapi:isInternal "true"^^xsd:boolean ; dynapi:hasType . - + a dynapi:Parameter ; - dynapi:name "person_given_name" ; + dynapi:name "first_name" ; dynapi:hasType . - + a dynapi:Parameter ; - dynapi:name "person_middle_name" ; + dynapi:name "middle_name" ; dynapi:hasType . - + a dynapi:Parameter ; - dynapi:name "person_last_name" ; + dynapi:name "last_name" ; dynapi:hasType . - + a dynapi:Parameter ; - dynapi:name "person_type" ; + dynapi:name "type" ; dynapi:hasType . - + a dynapi:Parameter ; - dynapi:name "person_positions" ; + dynapi:name "positions" ; dynapi:hasType . - + a dynapi:Parameter ; - dynapi:name "person_internal_id" ; + dynapi:name "internalID" ; dynapi:hasType . - + a dynapi:Parameter ; - dynapi:name "person_orcid" ; + dynapi:name "ORCID" ; dynapi:hasType . - + a dynapi:Parameter ; - dynapi:name "person_scopus_author_id" ; + dynapi:name "SCOPUSAuthorID" ; dynapi:hasType . - + a dynapi:Parameter ; - dynapi:name "person_researcher_id" ; + dynapi:name "ResearcherID" ; dynapi:hasType . ######################### From 361206e9c358f29f36744a25e77e9554e352461c Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 1 Jun 2023 15:06:51 +0200 Subject: [PATCH 03/38] Added person_for_deleting internal parameter definition. --- .../rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 5dd41f26e..80e3df9b2 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -266,7 +266,7 @@ ## Delete parameters ## ####################### - + a dynapi:Parameter ; rdfs:label "person for deleting"@en-US ; dynapi:name "stateOrProvinceForDeleting" ; From 49945148090e678c3a1a55c2886ae2909a0ce8eb Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 8 Jun 2023 16:22:35 +0200 Subject: [PATCH 04/38] Updated n3 files so they support optional fields for person entity. --- .../endpoint_procedure_CRUD_person.n3 | 411 ++++++++++++++---- 1 file changed, 325 insertions(+), 86 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 80e3df9b2..e55f38f0b 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -7,47 +7,209 @@ @prefix xsd: . ############################################### -### CREATE +### N3 TEMPLATE PARTIAL ENTITY CREATION ############################################### - - a dynapi:Procedure ; - rdfs:label "Create a person"@en-US ; - dynapi:hasFirstStep ; - dynapi:providesParameter . - - - a dynapi:OperationalStep ; - rdfs:label "Creation of a person by using N3 operation"@en-US ; - dynapi:hasOperation . - - - a dynapi:N3Template ; - rdfs:label "Create person N3 Template"@en-US ; + + a dynapi:operation, dynapi:operation, dynapi:N3Template ; + rdfs:label "create person N3 Template"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri . " . + + + a dynapi:operation, dynapi:operation, dynapi:N3Template ; + rdfs:label "create person first name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?first_name . " . + + + a dynapi:operation, dynapi:operation, dynapi:N3Template ; + rdfs:label "create person middle name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?middle_name . " . + + + a dynapi:operation, dynapi:operation, dynapi:N3Template ; + rdfs:label "create person last name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?last_name . " . + + + a dynapi:operation, dynapi:operation, dynapi:N3Template ; + rdfs:label "create person type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?type . " . + + + a dynapi:operation, dynapi:operation, dynapi:N3Template ; + rdfs:label "create person internal id N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?internalID . " . + + + a dynapi:operation, dynapi:operation, dynapi:N3Template ; + rdfs:label "create person ORCID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?ORCID . " . + + + a dynapi:operation, dynapi:operation, dynapi:N3Template ; + rdfs:label "create person SCOPUS author ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?SCOPUSAuthorID . " . + + + a dynapi:operation, dynapi:operation, dynapi:N3Template ; + rdfs:label "create person researcher ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?person_uri - ; - ?first_name ; - ?middle_name ; - ?last_name ; - ?type ; - ?internalID ; - ?ORCID ; - ?SCOPUSAuthorID; - ?ResearcherID . - """ . + dynapi:N3TextAdditions "?uri ?ResearcherID . " . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY DELETION +############################################### + + + a dynapi:operation, dynapi:N3Template ; + rdfs:label "delete person first name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.first_name . " . + + + a dynapi:operation, dynapi:N3Template ; + rdfs:label "delete person middle name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.middle_name . " . + + + a dynapi:operation, dynapi:N3Template ; + rdfs:label "delete person last name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.last_name . " . + + + a dynapi:operation, dynapi:N3Template ; + rdfs:label "delete person last name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.type . " . + + + a dynapi:operation, dynapi:N3Template ; + rdfs:label "delete person internal id N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.internalID . " . + + + a dynapi:operation, dynapi:N3Template ; + rdfs:label "delete person orcid N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.ORCID . " . + + + a dynapi:operation, dynapi:N3Template ; + rdfs:label "delete person SCOPUS author ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.SCOPUSAuthorID . " . + + + a dynapi:operation, dynapi:N3Template ; + rdfs:label "delete person researcher ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.ResearcherID . " . + + + a dynapi:operation, dynapi:N3Template ; + rdfs:label "delete person N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextRetractions "?person_for_deleting.0.uri . " . + +############################################### +### CREATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Create a person"@en-US ; + dynapi:hasFirstStep ; + dynapi:providesParameter . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation . ############################################### ### READ (all) @@ -61,7 +223,7 @@ dynapi:hasFirstStep . - a dynapi:OperationalStep ; + a dynapi:Step, dynapi:operationalStep ; rdfs:label "fetch persons step"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -95,7 +257,7 @@ """ . - a dynapi:OperationalStep ; + a dynapi:Step, dynapi:operationalStep ; rdfs:label "number of persons step "@en-US ; dynapi:hasOperation . @@ -124,7 +286,7 @@ dynapi:hasFirstStep . - a dynapi:OperationalStep ; + a dynapi:Step, dynapi:operationalStep ; rdfs:label "reading of a person"@en-US ; dynapi:hasOperation . @@ -157,48 +319,96 @@ ############################################### - a dynapi:Procedure ; - rdfs:label "Updating a person"@en-US ; - dynapi:hasFirstStep . + a dynapi:Procedure ; + rdfs:label "Updating a person"@en-US ; + dynapi:hasFirstStep . - a dynapi:OperationalStep ; - rdfs:label "Fetching of a person data for deleting"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Fetching of a person data for deleting"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person first name"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person middle name"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person last name"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person type"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person internal ID"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person ORCID"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person SCOPUS author ID"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person researcher id"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person entity subject"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . - a dynapi:OperationalStep ; - rdfs:label "creation of a person "@en-US ; - dynapi:hasOperation . + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Recreation of a person "@en-US ; + dynapi:hasNextStep . ############################################### ### DELETE ############################################### - a dynapi:Procedure ; - rdfs:label "Removing of a person"@en-US ; - dynapi:hasFirstStep . + a dynapi:Procedure ; + rdfs:label "Removing of a person"@en-US ; + dynapi:hasFirstStep . - a dynapi:OperationalStep ; - rdfs:label "Fetching of a person data for deleting"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Fetching of a person data for deleting"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . - a dynapi:SparqlSelectQuery ; - rdfs:label "Read persons sparql query"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:providesParameter ; + a dynapi:SparqlSelectQuery ; + rdfs:label "Read persons sparql query"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:providesParameter ; dynapi:sparqlQueryText """ SELECT ?uri ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID @@ -217,29 +427,58 @@ } """ . - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person"@en-US ; - dynapi:hasOperation . - - - a dynapi:N3Template ; - rdfs:label "delete person label N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextRetractions - """ - ?person_for_deleting.0.uri - ?person_for_deleting.0.type ; - ?person_for_deleting.0.first_name ; - ?person_for_deleting.0.middle_name ; - ?person_for_deleting.0.last_name ; - ?person_for_deleting.0.internalID ; - ?person_for_deleting.0.ORCID ; - ?person_for_deleting.0.SCOPUSAuthorID ; - ?person_for_deleting.0.ResearcherID ; - . - """ . + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person first name"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person middle name"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person last name"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person type"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person internal id"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person ORCID"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person SCOPUS author ID"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person researcher ID"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:Step, dynapi:operationalStep ; + rdfs:label "Deleting of a person subject entity"@en-US ; + dynapi:hasOperation . ############################################### ### PARAMETERS @@ -277,9 +516,9 @@ ## Creation fields ## ##################### - + a dynapi:Parameter ; - dynapi:name "person_uri" ; + dynapi:name "uri" ; dynapi:defaultValue "http://xmlns.com/foaf/0.1/Person#,java_uuid_number" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:hasType . From 1a444b5b3fb53f4fa7549cdeb26b3f32b9b4941b Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 9 Jun 2023 12:44:22 +0200 Subject: [PATCH 05/38] Updated RDF types and removed redundant definitions. --- .../endpoint_procedure_CRUD_person.n3 | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index e55f38f0b..646361e3f 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -11,14 +11,14 @@ ############################################### - a dynapi:operation, dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "create person N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextAdditions "?uri . " . - a dynapi:operation, dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "create person first name N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; @@ -26,7 +26,7 @@ dynapi:N3TextAdditions "?uri ?first_name . " . - a dynapi:operation, dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "create person middle name N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; @@ -34,7 +34,7 @@ dynapi:N3TextAdditions "?uri ?middle_name . " . - a dynapi:operation, dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "create person last name N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; @@ -42,7 +42,7 @@ dynapi:N3TextAdditions "?uri ?last_name . " . - a dynapi:operation, dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "create person type N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; @@ -50,7 +50,7 @@ dynapi:N3TextAdditions "?uri ?type . " . - a dynapi:operation, dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "create person internal id N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; @@ -58,7 +58,7 @@ dynapi:N3TextAdditions "?uri ?internalID . " . - a dynapi:operation, dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "create person ORCID N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; @@ -66,7 +66,7 @@ dynapi:N3TextAdditions "?uri ?ORCID . " . - a dynapi:operation, dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "create person SCOPUS author ID N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; @@ -74,7 +74,7 @@ dynapi:N3TextAdditions "?uri ?SCOPUSAuthorID . " . - a dynapi:operation, dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "create person researcher ID N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; @@ -86,63 +86,63 @@ ############################################### - a dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "delete person first name N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.first_name . " . - a dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "delete person middle name N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.middle_name . " . - a dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "delete person last name N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.last_name . " . - a dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "delete person last name N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.type . " . - a dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "delete person internal id N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.internalID . " . - a dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "delete person orcid N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.ORCID . " . - a dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "delete person SCOPUS author ID N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.SCOPUSAuthorID . " . - a dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "delete person researcher ID N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.ResearcherID . " . - a dynapi:operation, dynapi:N3Template ; + a dynapi:N3Template ; rdfs:label "delete person N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; @@ -159,55 +159,55 @@ dynapi:providesParameter . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:OperationalStep ; rdfs:label "creation of a person step 1"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "creation of a person step 1"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "creation of a person step 1"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "creation of a person step 1"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "creation of a person step 1"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "creation of a person step 1"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "creation of a person step 1"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "creation of a person step 1"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "creation of a person step 1"@en-US ; dynapi:hasOperation . @@ -223,7 +223,7 @@ dynapi:hasFirstStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:OperationalStep ; rdfs:label "fetch persons step"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -257,7 +257,7 @@ """ . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:OperationalStep ; rdfs:label "number of persons step "@en-US ; dynapi:hasOperation . @@ -286,7 +286,7 @@ dynapi:hasFirstStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:OperationalStep ; rdfs:label "reading of a person"@en-US ; dynapi:hasOperation . @@ -324,67 +324,67 @@ dynapi:hasFirstStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:OperationalStep ; rdfs:label "Fetching of a person data for deleting"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person first name"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person middle name"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person last name"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person type"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person internal ID"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person ORCID"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person SCOPUS author ID"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person researcher id"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person entity subject"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Recreation of a person "@en-US ; dynapi:hasNextStep . @@ -398,7 +398,7 @@ dynapi:hasFirstStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:OperationalStep ; rdfs:label "Fetching of a person data for deleting"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -428,55 +428,55 @@ """ . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person first name"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person middle name"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person last name"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person type"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person internal id"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person ORCID"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person SCOPUS author ID"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:ConditionalStep ; rdfs:label "Deleting of a person researcher ID"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:Step, dynapi:operationalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person subject entity"@en-US ; dynapi:hasOperation . From 10975c364c435abe59f5f120cedeac11c9db25ac Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 9 Jun 2023 16:26:39 +0200 Subject: [PATCH 06/38] Updated n3 files so that conditional steps are properly setup. --- .../endpoint_procedure_CRUD_person.n3 | 365 +++++++++++++++--- 1 file changed, 308 insertions(+), 57 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 646361e3f..4b4dbc73b 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -162,53 +162,108 @@ a dynapi:OperationalStep ; rdfs:label "creation of a person step 1"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; - rdfs:label "creation of a person step 1"@en-US ; + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 2"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person middle name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; - rdfs:label "creation of a person step 1"@en-US ; + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 3"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person last name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; - rdfs:label "creation of a person step 1"@en-US ; + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 4"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person type check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; - rdfs:label "creation of a person step 1"@en-US ; + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 5"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person internal id check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; - rdfs:label "creation of a person step 1"@en-US ; + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 6"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person ORCID check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; - rdfs:label "creation of a person step 1"@en-US ; + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 7"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; - rdfs:label "creation of a person step 1"@en-US ; + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 8"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; - rdfs:label "creation of a person step 1"@en-US ; + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 9"@en-US ; dynapi:hasOperation . ############################################### @@ -329,62 +384,118 @@ dynapi:hasOperation ; dynapi:hasNextStep . + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person first name"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person middle name attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person middle name"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person last name attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person last name"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person type attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person type"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person internal ID attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person internal ID"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person ORCID attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person ORCID"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person SCOPUS author ID attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person SCOPUS author ID"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person type attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person researcher id"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person entity subject"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Recreation of a person "@en-US ; dynapi:hasNextStep . @@ -401,7 +512,7 @@ a dynapi:OperationalStep ; rdfs:label "Fetching of a person data for deleting"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . a dynapi:SparqlSelectQuery ; @@ -427,50 +538,106 @@ } """ . + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person first name"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person middle name attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person middle name"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person last name attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person last name"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person type attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person type"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person internal ID attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person internal id"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person ORCID attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person ORCID"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person SCOPUS author ID attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person SCOPUS author ID"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person researcher ID attribute check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . - a dynapi:ConditionalStep ; + a dynapi:OperationalStep ; rdfs:label "Deleting of a person researcher ID"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -617,3 +784,87 @@ dynapi:name "http://xmlns.com/foaf/0.1/Person" ; rdfs:label "persons model"@en-US ; dynapi:hasType . + +############################################### +### PARAMETER CHECKS +############################################### + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person first name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person first name attribute is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person middle name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person middle name attribute is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person last name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person last name attribute is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person type is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person type attribute is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person internal ID is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person internal ID attribute is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person ORCID is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person orcid attribute is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person SCOPUS author id is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person SCOPUS author ID attribute is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person researcher ID is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person researcher ID attribute is defined"@en-US ; + dynapi:requiresParameter . From b0ae28d281005b264927bff4a2f0c024d32cdc19 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 12 Jun 2023 14:11:05 +0200 Subject: [PATCH 07/38] Updated n3 files. --- .../endpoint_procedure_CRUD_person.n3 | 428 +----------------- .../endpoint_resource_CRUD_person.n3 | 8 +- 2 files changed, 21 insertions(+), 415 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 4b4dbc73b..8558e9df4 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -13,7 +13,7 @@ a dynapi:N3Template ; rdfs:label "create person N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextAdditions "?uri . " . @@ -47,7 +47,7 @@ dynapi:hasModel ; dynapi:requiresParameter ; dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?type . " . + dynapi:N3TextAdditions "?uri ?type . " . a dynapi:N3Template ; @@ -81,73 +81,6 @@ dynapi:requiresParameter ; dynapi:N3TextAdditions "?uri ?ResearcherID . " . -############################################### -### N3 TEMPLATE PARTIAL ENTITY DELETION -############################################### - - - a dynapi:N3Template ; - rdfs:label "delete person first name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.first_name . " . - - - a dynapi:N3Template ; - rdfs:label "delete person middle name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.middle_name . " . - - - a dynapi:N3Template ; - rdfs:label "delete person last name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.last_name . " . - - - a dynapi:N3Template ; - rdfs:label "delete person last name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.type . " . - - - a dynapi:N3Template ; - rdfs:label "delete person internal id N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.internalID . " . - - - a dynapi:N3Template ; - rdfs:label "delete person orcid N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.ORCID . " . - - - a dynapi:N3Template ; - rdfs:label "delete person SCOPUS author ID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.SCOPUSAuthorID . " . - - - a dynapi:N3Template ; - rdfs:label "delete person researcher ID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextRetractions "?person_for_deleting.0.uri ?person_for_deleting.0.ResearcherID . " . - - - a dynapi:N3Template ; - rdfs:label "delete person N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextRetractions "?person_for_deleting.0.uri . " . - ############################################### ### CREATE ############################################### @@ -155,6 +88,7 @@ a dynapi:Procedure ; rdfs:label "Create a person"@en-US ; + dynapi:publicAccess "true"^^xsd:boolean ; dynapi:hasFirstStep ; dynapi:providesParameter . @@ -203,7 +137,7 @@ dynapi:hasOperation ; dynapi:hasNextStep . - + a dynapi:ConditionalStep ; rdfs:label "conditional step for person type check"@en-US ; dynapi:nextIfSatisfied ; @@ -273,6 +207,7 @@ a dynapi:Procedure ; rdfs:label "Fetching persons"@en-US ; + dynapi:publicAccess "true"^^xsd:boolean ; dynapi:providesParameter ; dynapi:providesParameter ; dynapi:hasFirstStep . @@ -288,20 +223,21 @@ rdfs:label "read persons sparql query"@en-US ; dynapi:hasModel ; dynapi:providesParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; dynapi:requiresPlainParameter ; dynapi:requiresPlainParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID + SELECT ?uri ?label ?type WHERE { ?uri OPTIONAL { ?uri ?first_name } OPTIONAL { ?uri ?middle_name } OPTIONAL { ?uri ?last_name } - OPTIONAL { ?uri ?type } + OPTIONAL { ?uri ?label } + OPTIONAL { ?uri ?type } OPTIONAL { ?uri ?internalID } OPTIONAL { ?uri ?ORCID } OPTIONAL { ?uri ?SCOPUSAuthorID } @@ -336,6 +272,7 @@ a dynapi:Procedure ; + dynapi:publicAccess "true"^^xsd:boolean ; rdfs:label "Fetching a person"@en-US ; dynapi:providesParameter ; dynapi:hasFirstStep . @@ -360,7 +297,7 @@ OPTIONAL { ?uri ?first_name } OPTIONAL { ?uri ?middle_name } OPTIONAL { ?uri ?last_name } - OPTIONAL { ?uri ?type } + OPTIONAL { ?uri ?type } OPTIONAL { ?uri ?internalID } OPTIONAL { ?uri ?ORCID } OPTIONAL { ?uri ?SCOPUSAuthorID } @@ -369,284 +306,6 @@ } """ . -############################################### -### UPDATE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Updating a person"@en-US ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "Fetching of a person data for deleting"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person first name"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person middle name attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person middle name"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person last name attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person last name"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person type attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person type"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person internal ID attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person internal ID"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person ORCID attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person ORCID"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person SCOPUS author ID attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person SCOPUS author ID"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person type attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person researcher id"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person entity subject"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:OperationalStep ; - rdfs:label "Recreation of a person "@en-US ; - dynapi:hasNextStep . - -############################################### -### DELETE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Removing of a person"@en-US ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "Fetching of a person data for deleting"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "Read persons sparql query"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:providesParameter ; - dynapi:sparqlQueryText - """ - SELECT ?uri ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID - WHERE - { - ?uri - OPTIONAL { ?uri ?first_name } - OPTIONAL { ?uri ?middle_name } - OPTIONAL { ?uri ?last_name } - OPTIONAL { ?uri ?type } - OPTIONAL { ?uri ?internalID } - OPTIONAL { ?uri ?ORCID } - OPTIONAL { ?uri ?SCOPUSAuthorID } - OPTIONAL { ?uri ?ResearcherID } - FILTER (?uri = ?resource_id) - } - """ . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person first name"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person middle name attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person middle name"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person last name attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person last name"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person type attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person type"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person internal ID attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person internal id"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person ORCID attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person ORCID"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person SCOPUS author ID attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person SCOPUS author ID"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person researcher ID attribute check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person researcher ID"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:OperationalStep ; - rdfs:label "Deleting of a person subject entity"@en-US ; - dynapi:hasOperation . - ############################################### ### PARAMETERS ############################################### @@ -658,7 +317,7 @@ a dynapi:Parameter ; rdfs:label "persons"@en-US ; - dynapi:name "result" ; + dynapi:name "persons" ; dynapi:description "List of available persons and statistics (number)" ; dynapi:hasType . @@ -668,17 +327,6 @@ dynapi:name "count" ; dynapi:hasType . -####################### -## Delete parameters ## -####################### - - - a dynapi:Parameter ; - rdfs:label "person for deleting"@en-US ; - dynapi:name "stateOrProvinceForDeleting" ; - dynapi:description "List of available persons" ; - dynapi:hasType . - ##################### ## Creation fields ## ##################### @@ -745,34 +393,34 @@ dynapi:hasType ; rdfs:label "resource uri"@en-US . - + a dynapi:parameter ; dynapi:name "total" ; dynapi:hasType ; rdfs:label "total"@en-US . - + a dynapi:parameter ; dynapi:name "limit" ; dynapi:defaultValue "20" ; dynapi:hasType ; rdfs:label "limit"@en-US . - + a dynapi:parameter ; dynapi:name "offset" ; dynapi:defaultValue "0" ; dynapi:hasType ; rdfs:label "offset"@en-US . - + a dynapi:parameter ; dynapi:name "sortBy" ; dynapi:defaultValue "label" ; dynapi:hasType ; rdfs:label "sortBy"@en-US . - + a dynapi:parameter ; dynapi:name "order" ; dynapi:defaultValue "ASC" ; @@ -794,77 +442,37 @@ rdfs:label "condition if person first name is defined"@en-US ; dynapi:requiresParameter . - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person first name attribute is defined"@en-US ; - dynapi:requiresParameter . - a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person middle name is defined"@en-US ; dynapi:requiresParameter . - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person middle name attribute is defined"@en-US ; - dynapi:requiresParameter . - a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person last name is defined"@en-US ; dynapi:requiresParameter . - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person last name attribute is defined"@en-US ; - dynapi:requiresParameter . - a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person type is defined"@en-US ; dynapi:requiresParameter . - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person type attribute is defined"@en-US ; - dynapi:requiresParameter . - a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person internal ID is defined"@en-US ; dynapi:requiresParameter . - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person internal ID attribute is defined"@en-US ; - dynapi:requiresParameter . - a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person ORCID is defined"@en-US ; dynapi:requiresParameter . - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person orcid attribute is defined"@en-US ; - dynapi:requiresParameter . - a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person SCOPUS author id is defined"@en-US ; dynapi:requiresParameter . - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person SCOPUS author ID attribute is defined"@en-US ; - dynapi:requiresParameter . - a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person researcher ID is defined"@en-US ; dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person researcher ID attribute is defined"@en-US ; - dynapi:requiresParameter . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 index a6a700c3b..5d77cacb3 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 @@ -3,13 +3,11 @@ - + a dynapi:ResourceAPI ; rdfs:label "person resource API 1"@en-US ; dynapi:name "person" ; - dynapi:minAPIVersion "1.0.0" ; + dynapi:minAPIVersion "0.1.0" ; dynapi:onPost ; dynapi:onGetAll ; - dynapi:onGet ; - dynapi:onPut ; - dynapi:onDelete . \ No newline at end of file + dynapi:onGet . \ No newline at end of file From 25ce0d14f30433e5d0dccb937769a7e2423ebdd7 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 15 Jun 2023 16:34:59 +0200 Subject: [PATCH 08/38] Updated parameter definitions with optional configuration. --- .../endpoint_procedure_CRUD_person.n3 | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 8558e9df4..47d74343c 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -341,46 +341,73 @@ a dynapi:Parameter ; dynapi:name "first_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . a dynapi:Parameter ; dynapi:name "middle_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . a dynapi:Parameter ; dynapi:name "last_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . a dynapi:Parameter ; dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . a dynapi:Parameter ; dynapi:name "positions" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . a dynapi:Parameter ; dynapi:name "internalID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . a dynapi:Parameter ; dynapi:name "ORCID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . a dynapi:Parameter ; dynapi:name "SCOPUSAuthorID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . a dynapi:Parameter ; dynapi:name "ResearcherID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . ######################### From ccec51fd13ffa76b83b8cce1470f9f8bd1101d65 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 16 Jun 2023 17:16:53 +0200 Subject: [PATCH 09/38] Updated n3 files. Made fetch parameters optional. --- .../everytime/endpoint_procedure_CRUD_person.n3 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 47d74343c..40a9b540b 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -229,7 +229,7 @@ dynapi:requiresPlainParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?label ?type + SELECT ?uri ?type WHERE { ?uri @@ -259,7 +259,7 @@ dynapi:providesParameter ; dynapi:sparqlQueryText """ - SELECT (count(distinct ?uri) as ?total) + SELECT (count(distinct ?uri) as ?count) WHERE { ?uri @@ -368,7 +368,7 @@ dynapi:defaultValue "" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + dynapi:hasType . a dynapi:Parameter ; @@ -430,6 +430,8 @@ a dynapi:parameter ; dynapi:name "limit" ; dynapi:defaultValue "20" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType ; rdfs:label "limit"@en-US . @@ -437,6 +439,8 @@ a dynapi:parameter ; dynapi:name "offset" ; dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType ; rdfs:label "offset"@en-US . @@ -444,6 +448,8 @@ a dynapi:parameter ; dynapi:name "sortBy" ; dynapi:defaultValue "label" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType ; rdfs:label "sortBy"@en-US . @@ -451,6 +457,8 @@ a dynapi:parameter ; dynapi:name "order" ; dynapi:defaultValue "ASC" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType ; rdfs:label "order"@en-US . From a13b21af0563ed31c344b3da654e83130e5b787c Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 21 Jun 2023 13:46:46 +0200 Subject: [PATCH 10/38] Added delete endpoint using construct queries. --- .../endpoint_procedure_CRUD_person.n3 | 114 +++++++++++++++--- .../endpoint_resource_CRUD_person.n3 | 3 +- 2 files changed, 98 insertions(+), 19 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 40a9b540b..46364cef1 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -216,7 +216,7 @@ a dynapi:OperationalStep ; rdfs:label "fetch persons step"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . a dynapi:SparqlSelectQuery ; @@ -229,7 +229,7 @@ dynapi:requiresPlainParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?type + SELECT ?uri ?label ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID WHERE { ?uri @@ -247,12 +247,12 @@ LIMIT ?limit OFFSET ?offset """ . - + a dynapi:OperationalStep ; rdfs:label "number of persons step "@en-US ; - dynapi:hasOperation . + dynapi:hasOperation . - + a dynapi:SparqlSelectQuery ; rdfs:label "number of persons sparql query 1"@en-US ; dynapi:hasModel ; @@ -270,10 +270,10 @@ ### READ (one) ############################################### - + a dynapi:Procedure ; - dynapi:publicAccess "true"^^xsd:boolean ; rdfs:label "Fetching a person"@en-US ; + dynapi:publicAccess "true"^^xsd:boolean ; dynapi:providesParameter ; dynapi:hasFirstStep . @@ -286,7 +286,7 @@ a dynapi:SparqlSelectQuery ; rdfs:label "read persons sparql query 1"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:providesParameter ; dynapi:sparqlQueryText """ @@ -302,10 +302,80 @@ OPTIONAL { ?uri ?ORCID } OPTIONAL { ?uri ?SCOPUSAuthorID } OPTIONAL { ?uri ?ResearcherID } - FILTER (?uri = ?resource_id) + FILTER (?uri = ?resource) } + LIMIT 1 """ . +############################################### +### DELETE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Deleting a person"@en-US ; + dynapi:publicAccess "true"^^xsd:boolean ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:SparqlConstructQuery ; + dynapi:sparqlQueryText """ + prefix dynapi: + prefix rdf: + prefix rdfs: + prefix xsd: + CONSTRUCT { + ?person_uri + rdf:type ; + ?first_name ; + ?middle_name ; + ?last_name ; + ?type ; + ?internalID ; + ?ORCID ; + ?SCOPUSAuthorID ; + ?ResearcherID . + + } WHERE { + ?person_uri rdf:type + OPTIONAL { ?person_uri ?first_name } + OPTIONAL { ?uperson_uri ?middle_name } + OPTIONAL { ?person_uri ?last_name } + OPTIONAL { ?person_uri ?type } + OPTIONAL { ?person_uri ?internalID } + OPTIONAL { ?person_uri ?ORCID } + OPTIONAL { ?person_uri ?SCOPUSAuthorID } + OPTIONAL { ?person_uri ?ResearcherID } + } + """ ; + dynapi:providesParameter ; + dynapi:requiresParameter ; + dynapi:hasModel . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + ############################################### ### PARAMETERS ############################################### @@ -368,7 +438,7 @@ dynapi:defaultValue "" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + dynapi:hasType . a dynapi:Parameter ; @@ -414,9 +484,9 @@ ## Read request fields ## ######################### - - a dynapi:parameter ; - dynapi:name "resource_id" ; + + a dynapi:Parameter ; + dynapi:name "resource" ; dynapi:hasType ; rdfs:label "resource uri"@en-US . @@ -462,11 +532,19 @@ dynapi:hasType ; rdfs:label "order"@en-US . - - a dynapi:Model ; - dynapi:name "http://xmlns.com/foaf/0.1/Person" ; - rdfs:label "persons model"@en-US ; - dynapi:hasType . +########################### +## Delete request fields ## +########################### + + + a dynapi:Model ; + dynapi:name "person_graph" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "person_uri" ; + dynapi:hasType . ############################################### ### PARAMETER CHECKS diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 index 5d77cacb3..513f7eed5 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 @@ -10,4 +10,5 @@ dynapi:minAPIVersion "0.1.0" ; dynapi:onPost ; dynapi:onGetAll ; - dynapi:onGet . \ No newline at end of file + dynapi:onGet ; + dynapi:onDelete . \ No newline at end of file From aba6ebec45ac752fcff29a09200f06d924ba03e4 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 22 Jun 2023 15:07:52 +0200 Subject: [PATCH 11/38] Added UPDATE endpoint as well as mandatory label field. --- .../endpoint_procedure_CRUD_person.n3 | 99 +++++++++++++++---- .../endpoint_resource_CRUD_person.n3 | 1 + 2 files changed, 82 insertions(+), 18 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 46364cef1..c17aefa59 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -15,7 +15,24 @@ rdfs:label "create person N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri . " . + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?uri ; + ?uri ?label . + """ . + + + a dynapi:N3Template ; + rdfs:label "create person N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?person_uri ; + ?person_uri ?label . + """ . a dynapi:N3Template ; @@ -290,13 +307,14 @@ dynapi:providesParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID + SELECT ?uri ?label ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID WHERE { ?uri OPTIONAL { ?uri ?first_name } OPTIONAL { ?uri ?middle_name } OPTIONAL { ?uri ?last_name } + OPTIONAL { ?uri ?label } OPTIONAL { ?uri ?type } OPTIONAL { ?uri ?internalID } OPTIONAL { ?uri ?ORCID } @@ -320,9 +338,9 @@ a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . + dynapi:hasOperation . - + a dynapi:SparqlConstructQuery ; dynapi:sparqlQueryText """ prefix dynapi: @@ -353,28 +371,69 @@ OPTIONAL { ?person_uri ?ResearcherID } } """ ; - dynapi:providesParameter ; - dynapi:requiresParameter ; - dynapi:hasModel . + dynapi:providesParameter ; + dynapi:requiresParameter ; + dynapi:hasModel . - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . - a dynapi:ModelWriter ; - dynapi:retractionModel ; - dynapi:targetModel . + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . - a dynapi:OperationalStep ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + dynapi:hasOperation . - a dynapi:ProcedurePoolAtomicOperation ; - dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + +############################################### +### UPDATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Updating a person"@en-US ; + dynapi:publicAccess "true"^^xsd:boolean ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person anew step"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . ############################################### ### PARAMETERS @@ -408,6 +467,10 @@ dynapi:isInternal "true"^^xsd:boolean ; dynapi:hasType . + + a dynapi:Parameter ; + dynapi:hasType . + a dynapi:Parameter ; dynapi:name "first_name" ; diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 index 513f7eed5..972bf9e2f 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 @@ -11,4 +11,5 @@ dynapi:onPost ; dynapi:onGetAll ; dynapi:onGet ; + dynapi:onPut ; dynapi:onDelete . \ No newline at end of file From 8f5df5be495b688789315af02263df6be68e287a Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 22 Jun 2023 15:09:15 +0200 Subject: [PATCH 12/38] Updated delete operation to delete label. --- .../dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index c17aefa59..1aa15d857 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -353,6 +353,7 @@ ?first_name ; ?middle_name ; ?last_name ; + ?label ; ?type ; ?internalID ; ?ORCID ; @@ -362,8 +363,9 @@ } WHERE { ?person_uri rdf:type OPTIONAL { ?person_uri ?first_name } - OPTIONAL { ?uperson_uri ?middle_name } + OPTIONAL { ?person_uri ?middle_name } OPTIONAL { ?person_uri ?last_name } + OPTIONAL { ?person_uri ?label } OPTIONAL { ?person_uri ?type } OPTIONAL { ?person_uri ?internalID } OPTIONAL { ?person_uri ?ORCID } From 35aae4b008baa9abc73f9d93760c37bcb04cc890 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 22 Jun 2023 15:12:01 +0200 Subject: [PATCH 13/38] Fixed .n3 notation syntax in partial creation of resource. --- .../dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 1aa15d857..66ebe8ea7 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -19,7 +19,7 @@ dynapi:N3TextAdditions """ ?uri ; - ?uri ?label . + ?label . """ . @@ -31,7 +31,7 @@ dynapi:N3TextAdditions """ ?person_uri ; - ?person_uri ?label . + ?label . """ . From 7923f5dded3dc74da0e6c0d20e1c028559e7ab06 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 22 Jun 2023 17:01:02 +0200 Subject: [PATCH 14/38] Updated update workflow. --- .../endpoint_procedure_CRUD_person.n3 | 245 +++++++++++++++--- 1 file changed, 208 insertions(+), 37 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 66ebe8ea7..7628e086a 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -22,18 +22,6 @@ ?label . """ . - - a dynapi:N3Template ; - rdfs:label "create person N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?person_uri ; - ?label . - """ . - a dynapi:N3Template ; rdfs:label "create person first name N3 Template"@en-US ; @@ -98,6 +86,86 @@ dynapi:requiresParameter ; dynapi:N3TextAdditions "?uri ?ResearcherID . " . +############################################### +### N3 TEMPLATE PARTIAL ENTITY UPDATE +############################################### + + + a dynapi:N3Template ; + rdfs:label "create person N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?resource_id ; + ?label . + """ . + + + a dynapi:N3Template ; + rdfs:label "create person first name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?first_name . " . + + + a dynapi:N3Template ; + rdfs:label "create person middle name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?middle_name . " . + + + a dynapi:N3Template ; + rdfs:label "create person last name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?last_name . " . + + + a dynapi:N3Template ; + rdfs:label "create person type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?type . " . + + + a dynapi:N3Template ; + rdfs:label "create person internal id N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?internalID . " . + + + a dynapi:N3Template ; + rdfs:label "create person ORCID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?ORCID . " . + + + a dynapi:N3Template ; + rdfs:label "create person SCOPUS author ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?SCOPUSAuthorID . " . + + + a dynapi:N3Template ; + rdfs:label "create person researcher ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?ResearcherID . " . + ############################################### ### CREATE ############################################### @@ -303,7 +371,7 @@ a dynapi:SparqlSelectQuery ; rdfs:label "read persons sparql query 1"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:providesParameter ; dynapi:sparqlQueryText """ @@ -320,7 +388,7 @@ OPTIONAL { ?uri ?ORCID } OPTIONAL { ?uri ?SCOPUSAuthorID } OPTIONAL { ?uri ?ResearcherID } - FILTER (?uri = ?resource) + FILTER (?uri = ?resource_id) } LIMIT 1 """ . @@ -348,7 +416,7 @@ prefix rdfs: prefix xsd: CONSTRUCT { - ?person_uri + ?resource_id rdf:type ; ?first_name ; ?middle_name ; @@ -361,20 +429,20 @@ ?ResearcherID . } WHERE { - ?person_uri rdf:type - OPTIONAL { ?person_uri ?first_name } - OPTIONAL { ?person_uri ?middle_name } - OPTIONAL { ?person_uri ?last_name } - OPTIONAL { ?person_uri ?label } - OPTIONAL { ?person_uri ?type } - OPTIONAL { ?person_uri ?internalID } - OPTIONAL { ?person_uri ?ORCID } - OPTIONAL { ?person_uri ?SCOPUSAuthorID } - OPTIONAL { ?person_uri ?ResearcherID } + ?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 } } """ ; dynapi:providesParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:hasModel . @@ -394,7 +462,7 @@ a dynapi:ProcedurePoolAtomicOperation ; dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . + dynapi:requiresParameter . ############################################### ### UPDATE @@ -423,19 +491,121 @@ a dynapi:OperationalStep ; - dynapi:hasNextStep ; + dynapi:hasNextStep ; dynapi:hasOperation . a dynapi:ProcedurePoolAtomicOperation ; dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . + dynapi:requiresParameter . - + a dynapi:OperationalStep ; - rdfs:label "creation of a person anew step"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person middle name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person last name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person type check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person internal id check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 6"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person ORCID check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 7"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 8"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 9"@en-US ; + dynapi:hasOperation . ############################################### ### PARAMETERS @@ -471,6 +641,7 @@ a dynapi:Parameter ; + dynapi:name "label" ; dynapi:hasType . @@ -549,9 +720,9 @@ ## Read request fields ## ######################### - + a dynapi:Parameter ; - dynapi:name "resource" ; + dynapi:name "resource_id" ; dynapi:hasType ; rdfs:label "resource uri"@en-US . @@ -606,9 +777,9 @@ dynapi:name "person_graph" ; dynapi:hasType . - + a dynapi:Parameter ; - dynapi:name "person_uri" ; + dynapi:name "resource_id" ; dynapi:hasType . ############################################### From 4ba24e78548268c2e5c93882b64a400b3d29be29 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 23 Jun 2023 17:17:22 +0200 Subject: [PATCH 15/38] Updated endpoints so all procedures use resource_id parameter for fetching resource from graph. --- .../endpoint_procedure_CRUD_person.n3 | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 7628e086a..a6c74f64e 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -94,7 +94,7 @@ a dynapi:N3Template ; rdfs:label "create person N3 Template"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:N3TextAdditions """ @@ -106,7 +106,7 @@ a dynapi:N3Template ; rdfs:label "create person first name N3 Template"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?first_name . " . @@ -114,7 +114,7 @@ a dynapi:N3Template ; rdfs:label "create person middle name N3 Template"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?middle_name . " . @@ -122,7 +122,7 @@ a dynapi:N3Template ; rdfs:label "create person last name N3 Template"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?last_name . " . @@ -130,7 +130,7 @@ a dynapi:N3Template ; rdfs:label "create person type N3 Template"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?type . " . @@ -138,7 +138,7 @@ a dynapi:N3Template ; rdfs:label "create person internal id N3 Template"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?internalID . " . @@ -146,7 +146,7 @@ a dynapi:N3Template ; rdfs:label "create person ORCID N3 Template"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?ORCID . " . @@ -154,7 +154,7 @@ a dynapi:N3Template ; rdfs:label "create person SCOPUS author ID N3 Template"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?SCOPUSAuthorID . " . @@ -162,7 +162,7 @@ a dynapi:N3Template ; rdfs:label "create person researcher ID N3 Template"@en-US ; dynapi:hasModel ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?ResearcherID . " . @@ -442,7 +442,7 @@ } """ ; dynapi:providesParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:hasModel . @@ -462,7 +462,7 @@ a dynapi:ProcedurePoolAtomicOperation ; dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . + dynapi:requiresParameter . ############################################### ### UPDATE @@ -497,7 +497,7 @@ a dynapi:ProcedurePoolAtomicOperation ; dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . + dynapi:requiresParameter . a dynapi:OperationalStep ; @@ -777,11 +777,6 @@ dynapi:name "person_graph" ; dynapi:hasType . - - a dynapi:Parameter ; - dynapi:name "resource_id" ; - dynapi:hasType . - ############################################### ### PARAMETER CHECKS ############################################### From 0c9c3d27505e5f982563496a79de35808d4f5164 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 30 Jun 2023 16:36:20 +0200 Subject: [PATCH 16/38] Fixed deletion bug, switched to using vivoweb.org abox assertion. --- .../dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index a6c74f64e..6588ee48d 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -443,7 +443,7 @@ """ ; dynapi:providesParameter ; dynapi:requiresParameter ; - dynapi:hasModel . + dynapi:hasModel . a dynapi:OperationalStep ; @@ -453,7 +453,7 @@ a dynapi:ModelWriter ; dynapi:retractionModel ; - dynapi:targetModel . + dynapi:targetModel . a dynapi:OperationalStep ; @@ -487,7 +487,7 @@ a dynapi:ModelWriter ; dynapi:retractionModel ; - dynapi:targetModel . + dynapi:targetModel . a dynapi:OperationalStep ; From f5663f062426f5682c7fb3ced0375b343d265907 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 31 Jul 2023 19:39:51 +0200 Subject: [PATCH 17/38] Added experimental multi language support. --- .../rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 6588ee48d..e89091743 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -650,7 +650,7 @@ dynapi:defaultValue "" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + dynapi:hasType . a dynapi:Parameter ; From f1e09b0e682cc393ba3ed27618c2d9178f7e75e9 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 2 Aug 2023 16:26:10 +0200 Subject: [PATCH 18/38] Implemented access controll in person CRUD endpoints. --- .../endpoint_procedure_CRUD_person.n3 | 286 +++++++++--------- 1 file changed, 147 insertions(+), 139 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index e89091743..896c01e22 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -173,7 +173,7 @@ a dynapi:Procedure ; rdfs:label "Create a person"@en-US ; - dynapi:publicAccess "true"^^xsd:boolean ; + dynapi:accessWhitelist ; dynapi:hasFirstStep ; dynapi:providesParameter . @@ -292,7 +292,7 @@ a dynapi:Procedure ; rdfs:label "Fetching persons"@en-US ; - dynapi:publicAccess "true"^^xsd:boolean ; + dynapi:accessWhitelist ; dynapi:providesParameter ; dynapi:providesParameter ; dynapi:hasFirstStep . @@ -333,15 +333,15 @@ """ . - a dynapi:OperationalStep ; - rdfs:label "number of persons step "@en-US ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + rdfs:label "number of persons step "@en-US ; + dynapi:hasOperation . - a dynapi:SparqlSelectQuery ; - rdfs:label "number of persons sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; + a dynapi:SparqlSelectQuery ; + rdfs:label "number of persons sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; dynapi:sparqlQueryText """ SELECT (count(distinct ?uri) as ?count) @@ -356,23 +356,23 @@ ############################################### - a dynapi:Procedure ; - rdfs:label "Fetching a person"@en-US ; - dynapi:publicAccess "true"^^xsd:boolean ; - dynapi:providesParameter ; - dynapi:hasFirstStep . + a dynapi:Procedure ; + rdfs:label "Fetching a person"@en-US ; + dynapi:accessWhitelist ; + dynapi:providesParameter ; + dynapi:hasFirstStep . - a dynapi:OperationalStep ; - rdfs:label "reading of a person"@en-US ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + rdfs:label "reading of a person"@en-US ; + dynapi:hasOperation . - a dynapi:SparqlSelectQuery ; - rdfs:label "read persons sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:providesParameter ; + a dynapi:SparqlSelectQuery ; + rdfs:label "read persons sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:providesParameter ; dynapi:sparqlQueryText """ SELECT ?uri ?label ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID @@ -398,15 +398,15 @@ ############################################### - a dynapi:Procedure ; - rdfs:label "Deleting a person"@en-US ; - dynapi:publicAccess "true"^^xsd:boolean ; - dynapi:hasFirstStep . + a dynapi:Procedure ; + rdfs:label "Deleting a person"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep . - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . a dynapi:SparqlConstructQuery ; @@ -616,166 +616,166 @@ ##################### - a dynapi:Parameter ; - rdfs:label "persons"@en-US ; - dynapi:name "persons" ; - dynapi:description "List of available persons and statistics (number)" ; - dynapi:hasType . + a dynapi:Parameter ; + rdfs:label "persons"@en-US ; + dynapi:name "persons" ; + dynapi:description "List of available persons and statistics (number)" ; + dynapi:hasType . - a dynapi:Parameter ; - rdfs:label "Number of fetched persons"@en-US ; - dynapi:name "count" ; - dynapi:hasType . + a dynapi:Parameter ; + rdfs:label "Number of fetched persons"@en-US ; + dynapi:name "count" ; + dynapi:hasType . ##################### ## Creation fields ## ##################### - 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 . + 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 . - a dynapi:Parameter ; - dynapi:name "label" ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "label" ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "first_name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "first_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "middle_name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "middle_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "last_name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "last_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "type" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "positions" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "positions" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "internalID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "internalID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "ORCID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "ORCID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "SCOPUSAuthorID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "SCOPUSAuthorID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "ResearcherID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "ResearcherID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . ######################### ## Read request fields ## ######################### - a dynapi:Parameter ; - dynapi:name "resource_id" ; - dynapi:hasType ; - rdfs:label "resource uri"@en-US . + a dynapi:Parameter ; + dynapi:name "resource_id" ; + dynapi:hasType ; + rdfs:label "resource uri"@en-US . - a dynapi:parameter ; - dynapi:name "total" ; - dynapi:hasType ; - rdfs:label "total"@en-US . + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType ; + rdfs:label "total"@en-US . - a dynapi:parameter ; - dynapi:name "limit" ; - dynapi:defaultValue "20" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "limit"@en-US . + a dynapi:parameter ; + dynapi:name "limit" ; + dynapi:defaultValue "20" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "limit"@en-US . - a dynapi:parameter ; - dynapi:name "offset" ; - dynapi:defaultValue "0" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "offset"@en-US . + a dynapi:parameter ; + dynapi:name "offset" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "offset"@en-US . - a dynapi:parameter ; - dynapi:name "sortBy" ; - dynapi:defaultValue "label" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "sortBy"@en-US . + a dynapi:parameter ; + dynapi:name "sortBy" ; + dynapi:defaultValue "label" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "sortBy"@en-US . - a dynapi:parameter ; - dynapi:name "order" ; - dynapi:defaultValue "ASC" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "order"@en-US . + a dynapi:parameter ; + dynapi:name "order" ; + dynapi:defaultValue "ASC" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "order"@en-US . ########################### ## Delete request fields ## ########################### - a dynapi:Model ; - dynapi:name "person_graph" ; - dynapi:hasType . + a dynapi:Model ; + dynapi:name "person_graph" ; + dynapi:hasType . ############################################### ### PARAMETER CHECKS @@ -820,3 +820,11 @@ a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person researcher ID is defined"@en-US ; dynapi:requiresParameter . + +############################################### +### ACCESS CONTROL +############################################### + + + a dynapi:GroupAccessWhitelist ; + dynapi:userGroup . From e25b2648d64c59475fbb4864bd001fae11cb8abf Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 10 Aug 2023 16:33:41 +0200 Subject: [PATCH 19/38] Started implementing person position creation loop. --- .../endpoint_procedure_CRUD_person.n3 | 166 +++++++++++++++++- 1 file changed, 165 insertions(+), 1 deletion(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index e89091743..643ddb672 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -276,7 +276,7 @@ a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; + rdfs:label "conditional step for person researcher ID check"@en-US ; dynapi:nextIfSatisfied ; dynapi:hasCondition . @@ -285,6 +285,123 @@ rdfs:label "creation of a person step 9"@en-US ; dynapi:hasOperation . + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasOperation ; + rdfs:label "Create provided person positions"@en-US . + +## Loop start + + + a dynapi:LoopOperation ; + #get positions from array + dynapi:inputDescriptor ; + dynapi:conditionDescriptor ; + + dynapi:outputDescriptor ; + dynapi:executableDescriptor ; + + dynapi:internalParameter ; + + dynapi:internalParameter ; + dynapi:providesParameter . + + + a dynapi:ProcedureDescriptor ; + dynapi:providesParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . + + + a dynapi:ProcedureDescriptor ; + dynapi:providesParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . + + + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter ; + dynapi:providesParameter ; + dynapi:call . + + + a dynapi:Procedure ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:SumOperation ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter ; + dynapi:call . + +## Loop end + +############################################################ +#Get position from a container + + + a dynapi:Procedure ; + dynapi:hasFirstStep ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:providesParameter ; + dynapi:targetContainer ; + dynapi:requiresParameter . + +############################################################ +#Condition procedure + + + a dynapi:Procedure ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:SumOperation ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + +############################################################ + ############################################### ### READ (all) ############################################### @@ -628,6 +745,43 @@ dynapi:name "count" ; dynapi:hasType . +###################### +## Iteration params ## +###################### + + + a dynapi:Parameter ; + dynapi:name "iteration_param" ; + dynapi:defaultValue "0" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "int_1" ; + dynapi:defaultValue "1" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "condition_result" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "condition_result" ; + dynapi:defaultValue "1" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "int_1" ; + dynapi:defaultValue "1" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + ##################### ## Creation fields ## ##################### @@ -716,6 +870,16 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . + + a dynapi:Parameter ; + dynapi:name "positions" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "item" ; + dynapi:hasType . + ######################### ## Read request fields ## ######################### From 967a2c5b689ce59208ef93faaf10e1e306dd1025 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 16 Aug 2023 14:28:46 +0200 Subject: [PATCH 20/38] Started working on executable descriptor. --- .../endpoint_procedure_CRUD_person.n3 | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 6d3fb44eb..5d5aab95b 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -283,13 +283,14 @@ a dynapi:OperationalStep ; rdfs:label "creation of a person step 9"@en-US ; - dynapi:hasOperation . + dynapi:hasOperation ; + dynapi:hasNextStep . a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; + rdfs:label "conditional step for person positions check"@en-US ; dynapi:nextIfSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; @@ -350,6 +351,7 @@ a dynapi:ProcedureDescriptor ; dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:call . ## Loop end @@ -401,6 +403,22 @@ dynapi:requiresParameter . ############################################################ +#Add person position construct query + + + a dynapi:Procedure ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . ############################################### ### READ (all) @@ -782,6 +800,13 @@ dynapi:isInternal "true"^^xsd:boolean ; dynapi:hasType . + + a dynapi:Parameter ; + dynapi:name "current_step_uri" ; + dynapi:defaultValue "https://vivoweb.org/procedure/create_person_position/step/,java_uuid_number" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + ##################### ## Creation fields ## ##################### From d2870b39c7e59e3d2bd039f73f1521801181c6a6 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 16 Aug 2023 14:33:55 +0200 Subject: [PATCH 21/38] Fixed formatting. --- .../endpoint_procedure_CRUD_person.n3 | 210 +++++++++--------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 5d5aab95b..fc58fc882 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -293,66 +293,66 @@ dynapi:hasCondition . - a dynapi:OperationalStep ; - dynapi:hasOperation ; - rdfs:label "Create provided person positions"@en-US . + a dynapi:OperationalStep ; + dynapi:hasOperation ; + rdfs:label "Create provided person positions"@en-US . ## Loop start - a dynapi:LoopOperation ; + a dynapi:LoopOperation ; #get positions from array - dynapi:inputDescriptor ; - dynapi:conditionDescriptor ; + dynapi:inputDescriptor ; + dynapi:conditionDescriptor ; - dynapi:outputDescriptor ; - dynapi:executableDescriptor ; + dynapi:outputDescriptor ; + dynapi:executableDescriptor ; - dynapi:internalParameter ; + dynapi:internalParameter ; - dynapi:internalParameter ; - dynapi:providesParameter . + dynapi:internalParameter ; + dynapi:providesParameter . - a dynapi:ProcedureDescriptor ; - dynapi:providesParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . + a dynapi:ProcedureDescriptor ; + dynapi:providesParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . - a dynapi:ProcedureDescriptor ; - dynapi:providesParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . + a dynapi:ProcedureDescriptor ; + dynapi:providesParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . - a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:providesParameter ; - dynapi:call . + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter ; + dynapi:providesParameter ; + dynapi:call . - a dynapi:Procedure ; - dynapi:providesParameter ; - dynapi:hasFirstStep . + a dynapi:Procedure ; + dynapi:providesParameter ; + dynapi:hasFirstStep . - a dynapi:OperationalStep ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + dynapi:hasOperation . - a dynapi:SumOperation ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:providesParameter . + a dynapi:SumOperation ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:providesParameter . - a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . ## Loop end @@ -360,65 +360,65 @@ #Get position from a container - a dynapi:Procedure ; - dynapi:hasFirstStep ; - dynapi:providesParameter . + a dynapi:Procedure ; + dynapi:hasFirstStep ; + dynapi:providesParameter . - a dynapi:OperationalStep ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + dynapi:hasOperation . - a dynapi:ContainerQuery ; - dynapi:providesParameter ; - dynapi:targetContainer ; - dynapi:requiresParameter . + a dynapi:ContainerQuery ; + dynapi:providesParameter ; + dynapi:targetContainer ; + dynapi:requiresParameter . ############################################################ #Condition procedure - a dynapi:Procedure ; - dynapi:providesParameter ; - dynapi:hasFirstStep . + a dynapi:Procedure ; + dynapi:providesParameter ; + dynapi:hasFirstStep . - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . - a dynapi:OperationalStep ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + dynapi:hasOperation . - a dynapi:SumOperation ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:providesParameter . + a dynapi:SumOperation ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:providesParameter . - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . ############################################################ #Add person position construct query - a dynapi:Procedure ; - dynapi:hasFirstStep . + a dynapi:Procedure ; + dynapi:hasFirstStep . - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . ############################################### ### READ (all) @@ -768,44 +768,44 @@ ###################### - a dynapi:Parameter ; - dynapi:name "iteration_param" ; - dynapi:defaultValue "0" ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "iteration_param" ; + dynapi:defaultValue "0" ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "int_1" ; - dynapi:defaultValue "1" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "int_1" ; + dynapi:defaultValue "1" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "condition_result" ; - dynapi:defaultValue "0" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "condition_result" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "condition_result" ; - dynapi:defaultValue "1" ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "condition_result" ; + dynapi:defaultValue "1" ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "int_1" ; - dynapi:defaultValue "1" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "int_1" ; + dynapi:defaultValue "1" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "current_step_uri" ; - dynapi:defaultValue "https://vivoweb.org/procedure/create_person_position/step/,java_uuid_number" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "current_step_uri" ; + dynapi:defaultValue "https://vivoweb.org/procedure/create_person_position/step/,java_uuid_number" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . ##################### ## Creation fields ## @@ -896,14 +896,14 @@ dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "positions" ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "positions" ; + dynapi:hasType . - a dynapi:Parameter ; - dynapi:name "item" ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "item" ; + dynapi:hasType . ######################### ## Read request fields ## From 26b4f471660660bd9141cb571b692ad6fbcad63a Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 17 Aug 2023 16:24:17 +0200 Subject: [PATCH 22/38] Added internal key parameters for position entity. Added JSOn container unwrapping for same entity. --- .../endpoint_procedure_CRUD_person.n3 | 163 +++++++++++++++++- 1 file changed, 159 insertions(+), 4 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index fc58fc882..811da896a 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -399,8 +399,8 @@ a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . + dynapi:targetContainer ; + dynapi:requiresParameter . ############################################################ #Add person position construct query @@ -409,6 +409,17 @@ a dynapi:Procedure ; dynapi:hasFirstStep . + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + a dynapi:OperationalStep ; dynapi:hasNextStep ; @@ -417,8 +428,54 @@ a dynapi:ContainerQuery ; dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + +# TODO: ADD N3 TEMPLATE FOR POSITION CREATION AND LINKING POSITION TO PERSON +# TODO: ADD PARAMETER CHECKS FOR POSITION ENTITY ############################################### ### READ (all) @@ -966,6 +1023,104 @@ dynapi:name "person_graph" ; dynapi:hasType . +############################################### +### POSITION FIELDS +############################################### + +# Internal + + + a dynapi:Parameter ; + dynapi:name "organizationUnitURI_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "organizationUnitURI" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "organizationUnitName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "organizationUnitName" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "positionName" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionType_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "positionType" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "startDate_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "startDate" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "endDate_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "endDate" ; + dynapi:hasType . + +# Provided + + + a dynapi:Parameter ; + dynapi:name "organizationUnitURI" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "organizationUnitName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionType" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "startDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "endDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + ############################################### ### PARAMETER CHECKS ############################################### From faf7dc58a4a6b6668a0dfcc974abe7eed03c5843 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 24 Aug 2023 15:08:48 +0200 Subject: [PATCH 23/38] Added position key checks and construct query to create them. Fixed some bugs. --- .../endpoint_procedure_CRUD_person.n3 | 120 ++++++++++++++++-- 1 file changed, 110 insertions(+), 10 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 811da896a..930808cf1 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -310,8 +310,8 @@ dynapi:internalParameter ; - dynapi:internalParameter ; - dynapi:providesParameter . + dynapi:internalParameter ; + dynapi:providesParameter . a dynapi:ProcedureDescriptor ; @@ -407,11 +407,17 @@ a dynapi:Procedure ; - dynapi:hasFirstStep . + dynapi:hasFirstStep . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . a dynapi:OperationalStep ; - dynapi:hasNextStep ; + dynapi:hasNextStep ; dynapi:hasOperation . @@ -420,9 +426,15 @@ dynapi:requiresParameter ; dynapi:providesParameter . + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + a dynapi:OperationalStep ; - dynapi:hasNextStep ; + dynapi:hasNextStep ; dynapi:hasOperation . @@ -431,9 +443,15 @@ dynapi:requiresParameter ; dynapi:providesParameter . + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + a dynapi:OperationalStep ; - dynapi:hasNextStep ; + dynapi:hasNextStep ; dynapi:hasOperation . @@ -442,9 +460,15 @@ dynapi:requiresParameter ; dynapi:providesParameter . + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + a dynapi:OperationalStep ; - dynapi:hasNextStep ; + dynapi:hasNextStep ; dynapi:hasOperation . @@ -453,9 +477,15 @@ dynapi:requiresParameter ; dynapi:providesParameter . + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + a dynapi:OperationalStep ; - dynapi:hasNextStep ; + dynapi:hasNextStep ; dynapi:hasOperation . @@ -464,8 +494,15 @@ dynapi:requiresParameter ; dynapi:providesParameter . + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + a dynapi:OperationalStep ; + dynapi:hasNextStep ; dynapi:hasOperation . @@ -474,8 +511,32 @@ dynapi:requiresParameter ; dynapi:providesParameter . -# TODO: ADD N3 TEMPLATE FOR POSITION CREATION AND LINKING POSITION TO PERSON -# TODO: ADD PARAMETER CHECKS FOR POSITION ENTITY + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:N3Template ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?current_step_uri ; + ?positionType ; + ?startDate ; + ?endDate . + + ?uri ?current_step_uri . + + """ . ############################################### ### READ (all) @@ -1125,6 +1186,8 @@ ### PARAMETER CHECKS ############################################### +# Person attributes + a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person first name is defined"@en-US ; @@ -1165,6 +1228,43 @@ rdfs:label "condition if person researcher ID is defined"@en-US ; dynapi:requiresParameter . + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person positions are defined"@en-US ; + dynapi:requiresParameter . + +# Person position container keys + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + ############################################### ### ACCESS CONTROL ############################################### From 089b3fd1a32f99ffc2bb564bad49812b24d4b3b5 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 25 Aug 2023 16:24:39 +0200 Subject: [PATCH 24/38] Fixed some bugs with type conversion. --- .../everytime/endpoint_procedure_CRUD_person.n3 | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 930808cf1..9bcbd497a 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -567,7 +567,7 @@ dynapi:requiresPlainParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?label ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID + SELECT ?uri ?label ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID ? position WHERE { ?uri @@ -580,6 +580,7 @@ OPTIONAL { ?uri ?ORCID } OPTIONAL { ?uri ?SCOPUSAuthorID } OPTIONAL { ?uri ?ResearcherID } + OPTIONAL { ?uri ?position } } ORDER BY ?order(??sortBy) LIMIT ?limit OFFSET ?offset @@ -628,7 +629,7 @@ dynapi:providesParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?label ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID + SELECT ?uri ?label ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID ?position WHERE { ?uri @@ -641,6 +642,7 @@ OPTIONAL { ?uri ?ORCID } OPTIONAL { ?uri ?SCOPUSAuthorID } OPTIONAL { ?uri ?ResearcherID } + OPTIONAL { ?uri ?position } FILTER (?uri = ?resource_id) } LIMIT 1 @@ -973,10 +975,10 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . - + a dynapi:Parameter ; dynapi:name "positions" ; - dynapi:defaultValue "" ; + dynapi:defaultValue "[]" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . @@ -1013,11 +1015,6 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . - - a dynapi:Parameter ; - dynapi:name "positions" ; - dynapi:hasType . - a dynapi:Parameter ; dynapi:name "item" ; @@ -1231,7 +1228,7 @@ a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person positions are defined"@en-US ; - dynapi:requiresParameter . + dynapi:requiresParameter . # Person position container keys From 46ab030175b95aa17f6ea722bc86a0b4fb16682a Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 30 Aug 2023 13:45:01 +0200 Subject: [PATCH 25/38] Added fetching person with all positions, fixed some bugs. --- .../endpoint_procedure_CRUD_person.n3 | 128 ++++++++++++------ 1 file changed, 87 insertions(+), 41 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 9bcbd497a..b3144ece6 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -289,9 +289,19 @@ a dynapi:ConditionalStep ; rdfs:label "conditional step for person positions check"@en-US ; - dynapi:nextIfSatisfied ; + dynapi:nextIfSatisfied ; dynapi:hasCondition . + + a dynapi:OperationalStep ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:AssignOperation ; + dynapi:assignableParameter ; + dynapi:targetParameter . + a dynapi:OperationalStep ; dynapi:hasOperation ; @@ -331,18 +341,18 @@ a dynapi:ProcedureDescriptor ; dynapi:requiresParameter ; dynapi:providesParameter ; - dynapi:call . + dynapi:call . - + a dynapi:Procedure ; dynapi:providesParameter ; - dynapi:hasFirstStep . + dynapi:hasFirstStep . - + a dynapi:OperationalStep ; - dynapi:hasOperation . + dynapi:hasOperation . - + a dynapi:SumOperation ; dynapi:requiresParameter ; dynapi:requiresParameter ; @@ -513,6 +523,7 @@ a dynapi:OperationalStep ; + dynapi:hasNextStep ; dynapi:hasOperation . @@ -524,6 +535,7 @@ dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions """ @prefix dynapi: . @@ -534,7 +546,23 @@ ?startDate ; ?endDate . - ?uri ?current_step_uri . + """ . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:N3Template ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?current_uri_persisted ?current_step_uri . """ . @@ -567,23 +595,29 @@ dynapi:requiresPlainParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?label ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID ? position - WHERE - { - ?uri - OPTIONAL { ?uri ?first_name } - OPTIONAL { ?uri ?middle_name } - OPTIONAL { ?uri ?last_name } - OPTIONAL { ?uri ?label } - OPTIONAL { ?uri ?type } - OPTIONAL { ?uri ?internalID } - OPTIONAL { ?uri ?ORCID } - OPTIONAL { ?uri ?SCOPUSAuthorID } - OPTIONAL { ?uri ?ResearcherID } - OPTIONAL { ?uri ?position } + SELECT ?uri ?type ?label ?first_name ?middle_name ?last_name ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID ?positionURI ?organizationUnitURI ?positionName ?positionType ?startDate ?endDate + WHERE { + ?uri a . + OPTIONAL { ?uri ?first_name } + OPTIONAL { ?uri ?middle_name } + OPTIONAL { ?uri ?last_name } + OPTIONAL { ?uri ?label } + OPTIONAL { ?uri ?internalID } + OPTIONAL { ?uri ?ORCID } + OPTIONAL { ?uri ?SCOPUSAuthorID } + OPTIONAL { ?uri ?ResearcherID } + OPTIONAL { + ?uri ?positionURI . + ?positionURI ?organizationUnitURI . + ?positionURI ?positionName . + ?positionURI ?positionType . + ?positionURI ?startDate . + ?positionURI ?endDate . } - ORDER BY ?order(??sortBy) - LIMIT ?limit OFFSET ?offset + } + ORDER BY ?label + LIMIT ?limit OFFSET ?offset + """ . @@ -629,23 +663,29 @@ dynapi:providesParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?label ?first_name ?middle_name ?last_name ?type ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID ?position - WHERE - { - ?uri - OPTIONAL { ?uri ?first_name } - OPTIONAL { ?uri ?middle_name } - OPTIONAL { ?uri ?last_name } - OPTIONAL { ?uri ?label } - OPTIONAL { ?uri ?type } - OPTIONAL { ?uri ?internalID } - OPTIONAL { ?uri ?ORCID } - OPTIONAL { ?uri ?SCOPUSAuthorID } - OPTIONAL { ?uri ?ResearcherID } - OPTIONAL { ?uri ?position } - FILTER (?uri = ?resource_id) + SELECT ?uri ?type ?label ?first_name ?middle_name ?last_name ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID ?positionURI ?organizationUnitURI ?positionName ?positionType ?startDate ?endDate + WHERE { + ?uri a . + OPTIONAL { ?uri ?first_name } + OPTIONAL { ?uri ?middle_name } + OPTIONAL { ?uri ?last_name } + OPTIONAL { ?uri ?label } + OPTIONAL { ?uri ?internalID } + OPTIONAL { ?uri ?ORCID } + OPTIONAL { ?uri ?SCOPUSAuthorID } + OPTIONAL { ?uri ?ResearcherID } + OPTIONAL { + ?uri ?positionURI . + ?positionURI ?organizationUnitURI . + ?positionURI ?positionName . + ?positionURI ?positionType . + ?positionURI ?startDate . + ?positionURI ?endDate . } - LIMIT 1 + FILTER (?uri = ?resource_id) + } + LIMIT 1 + """ . ############################################### @@ -923,7 +963,7 @@ a dynapi:Parameter ; dynapi:name "current_step_uri" ; - dynapi:defaultValue "https://vivoweb.org/procedure/create_person_position/step/,java_uuid_number" ; + dynapi:defaultValue "https://vivoweb.org/procedure/person_position/,java_uuid_number" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:hasType . @@ -931,6 +971,12 @@ ## Creation fields ## ##################### + + a dynapi:Parameter ; + dynapi:name "current_person_uri" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + a dynapi:Parameter ; dynapi:name "uri" ; From d819819a497dcce649ab5766415146e01f5ad054 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 1 Sep 2023 15:14:19 +0200 Subject: [PATCH 26/38] Added parameter substitution to generated uri to try to overcome persistence issue. --- .../endpoint_procedure_CRUD_person.n3 | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index b3144ece6..6c57f6826 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -289,21 +289,17 @@ a dynapi:ConditionalStep ; rdfs:label "conditional step for person positions check"@en-US ; - dynapi:nextIfSatisfied ; + dynapi:nextIfSatisfied ; dynapi:hasCondition . - - a dynapi:OperationalStep ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:AssignOperation ; - dynapi:assignableParameter ; - dynapi:targetParameter . + + a dynapi:ParameterSubstitution ; + dynapi:substitutionSource ; + dynapi:substitutionTarget . a dynapi:OperationalStep ; + dynapi:hasParameterSubstitution ; dynapi:hasOperation ; rdfs:label "Create provided person positions"@en-US . @@ -972,10 +968,9 @@ ##################### - a dynapi:Parameter ; - dynapi:name "current_person_uri" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . + a dynapi:Parameter ; + dynapi:name "current_uri_persisted" ; + dynapi:hasType . a dynapi:Parameter ; From 6c2a49dd1c35cee329f356b4dd18e5f9a98226c0 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 4 Sep 2023 16:09:21 +0200 Subject: [PATCH 27/38] Added OU procedures. Fixed bugs when reading person. --- ...dpoint_procedure_CRUD_organisation_unit.n3 | 634 ++++++++++++++++++ .../endpoint_procedure_CRUD_person.n3 | 39 +- ...dpoint_resource_CRUD_organisation_units.n3 | 15 + 3 files changed, 669 insertions(+), 19 deletions(-) create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_units.n3 diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 new file mode 100644 index 000000000..2d4b2c497 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 @@ -0,0 +1,634 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY CREATION +############################################### + + + a dynapi:N3Template ; + rdfs:label "create OU N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?uri ; + """ . + + + a dynapi:N3Template ; + rdfs:label "create OU type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?type . " . + + + a dynapi:N3Template ; + rdfs:label "create OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?name . " . + + + a dynapi:N3Template ; + rdfs:label "create OU description N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?description . " . + + + a dynapi:N3Template ; + rdfs:label "create super OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?superURI . " . + + + a dynapi:N3Template ; + rdfs:label "create super OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?superName . " . + + +############################################### +### N3 TEMPLATE PARTIAL ENTITY UPDATE +############################################### + + + a dynapi:N3Template ; + rdfs:label "update OU N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?resource_id ; + """ . + + + a dynapi:N3Template ; + rdfs:label "update OU type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?type . " . + + + a dynapi:N3Template ; + rdfs:label "update OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?name . " . + + + a dynapi:N3Template ; + rdfs:label "update OU description N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?description . " . + + + a dynapi:N3Template ; + rdfs:label "update super OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?superURI . " . + + + a dynapi:N3Template ; + rdfs:label "update super OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?superName . " . + +############################################### +### CREATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Create a OU"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU type check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU description check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU URI check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 6"@en-US ; + dynapi:hasOperation . + +############################################### +### READ (all) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching OUs"@en-US ; + dynapi:accessWhitelist ; + dynapi:providesParameter ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "fetch OUs step"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read OUs sparql query"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:sparqlQueryText + """ + SELECT ?uri (GROUP_CONCAT(DISTINCT ?type; separator="|") as ?typeList) (SAMPLE(?name) as ?sampleName) (SAMPLE(?description) as ?sampleDescription) (SAMPLE(?superOrganizationUnitUri) as ?sampleSuperOrganizationUnitUri) (SAMPLE(?superOrganizationUnitName) as ?sampleSuperOrganizationUnitName) + WHERE { + ?uri a . + OPTIONAL { ?uri ?type } + OPTIONAL { ?uri ?name } + OPTIONAL { ?uri ?description } + OPTIONAL { ?uri ?superOrganizationUnitUri } + OPTIONAL { ?uri ?superOrganizationUnitName } + } + GROUP BY ?uri + ORDER BY ?label + LIMIT ?limit OFFSET ?offset + + """ . + + + a dynapi:OperationalStep ; + rdfs:label "number of OUs step "@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "number of OUs sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; + dynapi:sparqlQueryText + """ + SELECT (count(distinct ?uri) as ?count) + WHERE + { + ?uri + } + """ . + +############################################### +### READ (one) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching a OU"@en-US ; + dynapi:accessWhitelist ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "reading of a OU"@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read OU sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:providesParameter ; + dynapi:sparqlQueryText + """ + SELECT ?uri ?type ?name ?description ?superOrganizationUnitUri ?superOrganizationUnitName + WHERE { + ?uri a . + OPTIONAL { ?uri ?type } + OPTIONAL { ?uri ?name } + OPTIONAL { ?uri ?description } + OPTIONAL { ?uri ?superOrganizationUnitUri } + OPTIONAL { ?uri ?superOrganizationUnitName } + FILTER (?uri = ?resource_id) + } + LIMIT 1 OFFSET 1 + """ . + +############################################### +### DELETE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Deleting a OU"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + 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 ; + dynapi:requiresParameter ; + dynapi:hasModel . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + +############################################### +### UPDATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Updating a OU"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU type check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU description check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU URI check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 6"@en-US ; + dynapi:hasOperation . + +############################################### +### PARAMETERS +############################################### + +################################ +## Organization unit response ## +################################ + + + a dynapi:Parameter ; + rdfs:label "organizationUnits"@en-US ; + dynapi:name "organizationUnits" ; + dynapi:description "List of available OUs and statistics (number)" ; + dynapi:hasType . + + + a dynapi:Parameter ; + rdfs:label "Number of fetched OUs"@en-US ; + dynapi:name "count" ; + dynapi:hasType . + +##################### +## Creation fields ## +##################### + + + 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 . + + + a dynapi:Parameter ; + dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "description" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "superURI" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "superName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + +######################### +## Read request fields ## +######################### + + + a dynapi:Parameter ; + dynapi:name "resource_id" ; + dynapi:hasType ; + rdfs:label "resource uri"@en-US . + + + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType ; + rdfs:label "total"@en-US . + + + a dynapi:parameter ; + dynapi:name "limit" ; + dynapi:defaultValue "20" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "limit"@en-US . + + + a dynapi:parameter ; + dynapi:name "offset" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "offset"@en-US . + + + a dynapi:parameter ; + dynapi:name "sortBy" ; + dynapi:defaultValue "label" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "sortBy"@en-US . + + + a dynapi:parameter ; + dynapi:name "order" ; + dynapi:defaultValue "ASC" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "order"@en-US . + +########################### +## Delete request fields ## +########################### + + + a dynapi:Model ; + dynapi:name "organization_unit_graph" ; + dynapi:hasType . + +############################################### +### PARAMETER CHECKS +############################################### + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if OU type is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if OU name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if OU description is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if super OU is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if super OU name is defined"@en-US ; + dynapi:requiresParameter . + + +############################################### +### ACCESS CONTROL +############################################### + + + a dynapi:GroupAccessWhitelist ; + dynapi:userGroup . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 6c57f6826..f6baf2a8f 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -92,7 +92,7 @@ a dynapi:N3Template ; - rdfs:label "create person N3 Template"@en-US ; + rdfs:label "update person N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:requiresParameter ; @@ -104,7 +104,7 @@ a dynapi:N3Template ; - rdfs:label "create person first name N3 Template"@en-US ; + rdfs:label "update person first name N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:requiresParameter ; @@ -112,7 +112,7 @@ a dynapi:N3Template ; - rdfs:label "create person middle name N3 Template"@en-US ; + rdfs:label "update person middle name N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:requiresParameter ; @@ -120,7 +120,7 @@ a dynapi:N3Template ; - rdfs:label "create person last name N3 Template"@en-US ; + rdfs:label "update person last name N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:requiresParameter ; @@ -128,7 +128,7 @@ a dynapi:N3Template ; - rdfs:label "create person type N3 Template"@en-US ; + rdfs:label "update person type N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:requiresParameter ; @@ -136,7 +136,7 @@ a dynapi:N3Template ; - rdfs:label "create person internal id N3 Template"@en-US ; + rdfs:label "update person internal id N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:requiresParameter ; @@ -144,7 +144,7 @@ a dynapi:N3Template ; - rdfs:label "create person ORCID N3 Template"@en-US ; + rdfs:label "update person ORCID N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:requiresParameter ; @@ -152,7 +152,7 @@ a dynapi:N3Template ; - rdfs:label "create person SCOPUS author ID N3 Template"@en-US ; + rdfs:label "update person SCOPUS author ID N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:requiresParameter ; @@ -160,7 +160,7 @@ a dynapi:N3Template ; - rdfs:label "create person researcher ID N3 Template"@en-US ; + rdfs:label "update person researcher ID N3 Template"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:requiresParameter ; @@ -539,6 +539,7 @@ ?current_step_uri ; ?positionType ; + ?organizationUnitURI ; ?startDate ; ?endDate . @@ -604,11 +605,11 @@ OPTIONAL { ?uri ?ResearcherID } OPTIONAL { ?uri ?positionURI . - ?positionURI ?organizationUnitURI . + ?positionURI ?organizationUnitURI . ?positionURI ?positionName . - ?positionURI ?positionType . - ?positionURI ?startDate . - ?positionURI ?endDate . + ?positionURI ?positionType . + ?positionURI ?startDate . + ?positionURI ?endDate . } } ORDER BY ?label @@ -653,7 +654,7 @@ a dynapi:SparqlSelectQuery ; - rdfs:label "read persons sparql query 1"@en-US ; + rdfs:label "read person sparql query 1"@en-US ; dynapi:hasModel ; dynapi:requiresParameter ; dynapi:providesParameter ; @@ -672,11 +673,11 @@ OPTIONAL { ?uri ?ResearcherID } OPTIONAL { ?uri ?positionURI . - ?positionURI ?organizationUnitURI . + ?positionURI ?organizationUnitURI . ?positionURI ?positionName . - ?positionURI ?positionType . - ?positionURI ?startDate . - ?positionURI ?endDate . + ?positionURI ?positionType . + ?positionURI ?startDate . + ?positionURI ?endDate . } FILTER (?uri = ?resource_id) } @@ -762,7 +763,7 @@ a dynapi:Procedure ; rdfs:label "Updating a person"@en-US ; - dynapi:publicAccess "true"^^xsd:boolean ; + dynapi:accessWhitelist ; dynapi:hasFirstStep . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_units.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_units.n3 new file mode 100644 index 000000000..a70df84a9 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_units.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 . \ No newline at end of file From f49bf1a4e08b83a79cd827e22060b466cb997c42 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Tue, 5 Sep 2023 17:28:12 +0200 Subject: [PATCH 28/38] Added creation and update of OUs with payload as specified as in issue. Added missing fields to person position creation. --- ...dpoint_procedure_CRUD_organisation_unit.n3 | 300 +++++++++++------- .../endpoint_procedure_CRUD_person.n3 | 11 +- ...dpoint_resource_CRUD_organisation_units.n3 | 18 +- 3 files changed, 207 insertions(+), 122 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 index 2d4b2c497..eda5a177d 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 @@ -13,7 +13,7 @@ a dynapi:N3Template ; rdfs:label "create OU N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextAdditions """ @@ -23,44 +23,43 @@ a dynapi:N3Template ; rdfs:label "create OU type N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions "?uri ?type . " . a dynapi:N3Template ; rdfs:label "create OU name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions "?uri ?name . " . a dynapi:N3Template ; rdfs:label "create OU description N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions "?uri ?description . " . a dynapi:N3Template ; rdfs:label "create super OU name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions "?uri ?superURI . " . a dynapi:N3Template ; rdfs:label "create super OU name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions "?uri ?superName . " . - ############################################### ### N3 TEMPLATE PARTIAL ENTITY UPDATE ############################################### @@ -68,7 +67,7 @@ a dynapi:N3Template ; rdfs:label "update OU N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; dynapi:N3TextAdditions """ @@ -78,41 +77,41 @@ a dynapi:N3Template ; rdfs:label "update OU type N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?type . " . a dynapi:N3Template ; rdfs:label "update OU name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?name . " . a dynapi:N3Template ; rdfs:label "update OU description N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?description . " . a dynapi:N3Template ; rdfs:label "update super OU name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?superURI . " . a dynapi:N3Template ; rdfs:label "update super OU name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions "?resource_id ?superName . " . ############################################### @@ -120,17 +119,17 @@ ############################################### - a dynapi:Procedure ; - rdfs:label "Create a OU"@en-US ; + a dynapi:Procedure ; + rdfs:label "Create a OU"@en-US ; dynapi:accessWhitelist ; - dynapi:hasFirstStep ; + dynapi:hasFirstStep ; dynapi:providesParameter . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . a dynapi:ConditionalStep ; @@ -140,10 +139,10 @@ dynapi:hasCondition . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . a dynapi:ConditionalStep ; @@ -153,47 +152,75 @@ dynapi:hasCondition . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . a dynapi:ConditionalStep ; rdfs:label "conditional step for OU description check"@en-US ; dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; + dynapi:nextIfNotSatisfied ; dynapi:hasCondition . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU URI check"@en-US ; - dynapi:nextIfSatisfied ; + rdfs:label "conditional step for super OU URI check"@en-US ; + dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . a dynapi:ConditionalStep ; rdfs:label "conditional step for super OU name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 6"@en-US ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 6"@en-US ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . ############################################### ### READ (all) @@ -204,51 +231,54 @@ rdfs:label "Fetching OUs"@en-US ; dynapi:accessWhitelist ; dynapi:providesParameter ; - dynapi:providesParameter ; - dynapi:hasFirstStep . + dynapi:providesParameter ; + dynapi:hasFirstStep . a dynapi:OperationalStep ; rdfs:label "fetch OUs step"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasOperation ; + dynapi:hasNextStep . a dynapi:SparqlSelectQuery ; rdfs:label "read OUs sparql query"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; + dynapi:hasModel ; + dynapi:providesParameter ; dynapi:requiresPlainParameter ; dynapi:requiresPlainParameter ; dynapi:requiresPlainParameter ; dynapi:requiresPlainParameter ; dynapi:sparqlQueryText """ - SELECT ?uri (GROUP_CONCAT(DISTINCT ?type; separator="|") as ?typeList) (SAMPLE(?name) as ?sampleName) (SAMPLE(?description) as ?sampleDescription) (SAMPLE(?superOrganizationUnitUri) as ?sampleSuperOrganizationUnitUri) (SAMPLE(?superOrganizationUnitName) as ?sampleSuperOrganizationUnitName) + 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 ?type } - OPTIONAL { ?uri ?name } - OPTIONAL { ?uri ?description } - OPTIONAL { ?uri ?superOrganizationUnitUri } - OPTIONAL { ?uri ?superOrganizationUnitName } + 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 - """ . a dynapi:OperationalStep ; rdfs:label "number of OUs step "@en-US ; - dynapi:hasOperation . + dynapi:hasOperation . a dynapi:SparqlSelectQuery ; rdfs:label "number of OUs sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; + dynapi:hasModel ; + dynapi:providesParameter ; dynapi:sparqlQueryText """ SELECT (count(distinct ?uri) as ?count) @@ -266,20 +296,20 @@ a dynapi:Procedure ; rdfs:label "Fetching a OU"@en-US ; dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:hasFirstStep . + dynapi:providesParameter ; + dynapi:hasFirstStep . - a dynapi:OperationalStep ; - rdfs:label "reading of a OU"@en-US ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + rdfs:label "reading of a OU"@en-US ; + dynapi:hasOperation . a dynapi:SparqlSelectQuery ; rdfs:label "read OU sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:providesParameter ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:providesParameter ; dynapi:sparqlQueryText """ SELECT ?uri ?type ?name ?description ?superOrganizationUnitUri ?superOrganizationUnitName @@ -394,10 +424,10 @@ dynapi:requiresParameter . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . a dynapi:ConditionalStep ; @@ -407,10 +437,10 @@ dynapi:hasCondition . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . a dynapi:ConditionalStep ; @@ -420,47 +450,63 @@ dynapi:hasCondition . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . a dynapi:ConditionalStep ; rdfs:label "conditional step for OU description check"@en-US ; dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; + dynapi:nextIfNotSatisfied ; dynapi:hasCondition . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU URI check"@en-US ; - dynapi:nextIfSatisfied ; + rdfs:label "conditional step for super OU URI check"@en-US ; + dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . a dynapi:ConditionalStep ; rdfs:label "conditional step for super OU name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . - a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 6"@en-US ; - dynapi:hasOperation . + a dynapi:OperationalStep ; + rdfs:label "creation of a OU step 6"@en-US ; + dynapi:hasOperation . ############################################### ### PARAMETERS @@ -534,6 +580,30 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . + + a dynapi:Parameter ; + dynapi:name "superOrganizationUnit" ; + dynapi:defaultValue "{}" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + +# Super Organisation Unit keys + + + a dynapi:Parameter ; + dynapi:name "superOrganizationUnitURI_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "uri" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "superOrganizationUnitName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "name" ; + dynapi:hasType . + ######################### ## Read request fields ## ######################### @@ -624,6 +694,20 @@ rdfs:label "condition if super OU name is defined"@en-US ; dynapi:requiresParameter . + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if super OU is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . ############################################### ### ACCESS CONTROL diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index f6baf2a8f..0bc9f25de 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -538,7 +538,8 @@ @prefix rdfs: . ?current_step_uri ; - ?positionType ; + ?positionType ; + ?organizationUnitName ; ?organizationUnitURI ; ?startDate ; ?endDate . @@ -606,8 +607,8 @@ OPTIONAL { ?uri ?positionURI . ?positionURI ?organizationUnitURI . - ?positionURI ?positionName . - ?positionURI ?positionType . + ?positionURI ?positionName . + ?positionURI ?positionType . ?positionURI ?startDate . ?positionURI ?endDate . } @@ -674,8 +675,8 @@ OPTIONAL { ?uri ?positionURI . ?positionURI ?organizationUnitURI . - ?positionURI ?positionName . - ?positionURI ?positionType . + ?positionURI ?positionName . + ?positionURI ?positionType . ?positionURI ?startDate . ?positionURI ?endDate . } diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_units.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_units.n3 index a70df84a9..8d1189ed7 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_units.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_units.n3 @@ -4,12 +4,12 @@ - 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 . \ No newline at end of file + 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 . From b73ba5b8bbbc29804d88328c7cdd97fc4c0bc490 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Tue, 5 Sep 2023 17:29:03 +0200 Subject: [PATCH 29/38] Renamed units to unit in file name. --- ...ation_units.n3 => endpoint_resource_CRUD_organisation_unit.n3} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename home/src/main/resources/rdf/dynapiAbox/everytime/{endpoint_resource_CRUD_organisation_units.n3 => endpoint_resource_CRUD_organisation_unit.n3} (100%) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_units.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_unit.n3 similarity index 100% rename from home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_units.n3 rename to home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_unit.n3 From 0a0c049e042b039d6041143f4b873ba45354d79f Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 6 Sep 2023 19:04:22 +0200 Subject: [PATCH 30/38] Added person positions update. Found a way to embed JSON into SPARQL query response. --- .../endpoint_procedure_CRUD_person.n3 | 269 +++++++++++++++--- 1 file changed, 227 insertions(+), 42 deletions(-) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index 0bc9f25de..b536f0302 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -539,6 +539,7 @@ ?current_step_uri ; ?positionType ; + ?positionName ; ?organizationUnitName ; ?organizationUnitURI ; ?startDate ; @@ -564,6 +565,88 @@ """ . +############################################################ +#Update person position construct query + + + a dynapi:Procedure ; + dynapi:hasFirstStep . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + ############################################### ### READ (all) ############################################### @@ -593,26 +676,52 @@ dynapi:requiresPlainParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?type ?label ?first_name ?middle_name ?last_name ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID ?positionURI ?organizationUnitURI ?positionName ?positionType ?startDate ?endDate + 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(?positionName), STR(?positionName), ''), + '", "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 ?first_name } - OPTIONAL { ?uri ?middle_name } - OPTIONAL { ?uri ?last_name } - OPTIONAL { ?uri ?label } - OPTIONAL { ?uri ?internalID } - OPTIONAL { ?uri ?ORCID } - OPTIONAL { ?uri ?SCOPUSAuthorID } - OPTIONAL { ?uri ?ResearcherID } + 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 . - ?positionURI ?organizationUnitURI . - ?positionURI ?positionName . - ?positionURI ?positionType . - ?positionURI ?startDate . - ?positionURI ?endDate . + 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 @@ -661,29 +770,53 @@ dynapi:providesParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?type ?label ?first_name ?middle_name ?last_name ?internalID ?ORCID ?SCOPUSAuthorID ?ResearcherID ?positionURI ?organizationUnitURI ?positionName ?positionType ?startDate ?endDate + 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(?positionName), STR(?positionName), ''), + '", "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 ?first_name } - OPTIONAL { ?uri ?middle_name } - OPTIONAL { ?uri ?last_name } - OPTIONAL { ?uri ?label } - OPTIONAL { ?uri ?internalID } - OPTIONAL { ?uri ?ORCID } - OPTIONAL { ?uri ?SCOPUSAuthorID } - OPTIONAL { ?uri ?ResearcherID } + 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 . - ?positionURI ?organizationUnitURI . - ?positionURI ?positionName . - ?positionURI ?positionType . - ?positionURI ?startDate . - ?positionURI ?endDate . + 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 - """ . ############################################### @@ -709,18 +842,25 @@ prefix rdfs: prefix xsd: CONSTRUCT { - ?resource_id - rdf:type ; - ?first_name ; - ?middle_name ; - ?last_name ; - ?label ; - ?type ; - ?internalID ; - ?ORCID ; - ?SCOPUSAuthorID ; - ?ResearcherID . - + ?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 } @@ -732,6 +872,14 @@ 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 ; @@ -898,7 +1046,44 @@ a dynapi:OperationalStep ; rdfs:label "creation of a person step 9"@en-US ; - dynapi:hasOperation . + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person positions check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:ParameterSubstitution ; + dynapi:substitutionSource ; + dynapi:substitutionTarget . + + + a dynapi:OperationalStep ; + dynapi:hasParameterSubstitution ; + dynapi:hasOperation ; + rdfs:label "Create provided person positions"@en-US . + + + a dynapi:LoopOperation ; + dynapi:inputDescriptor ; + dynapi:conditionDescriptor ; + + dynapi:outputDescriptor ; + dynapi:executableDescriptor ; + + dynapi:internalParameter ; + + dynapi:internalParameter ; + dynapi:providesParameter . + + + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . ############################################### ### PARAMETERS From ca97eb23ee12e60f26472ffca4d26b2f8eb47e6b Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 8 Sep 2023 14:15:57 +0200 Subject: [PATCH 31/38] Added event n3 files with creation, deletion and basic reads. Fixed some bugs and naming errors in person and OU n3 files. --- ...dpoint_procedure_CRUD_organisation_unit.n3 | 62 +- .../endpoint_procedure_CRUD_person.n3 | 3 +- .../everytime/endpoint_resource_CRUD_event.n3 | 15 + .../everytime/enpoint_procedure_CRUD_event.n3 | 720 ++++++++++++++++++ 4 files changed, 769 insertions(+), 31 deletions(-) create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_event.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/enpoint_procedure_CRUD_event.n3 diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 index eda5a177d..62afc0370 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 @@ -3,7 +3,7 @@ @prefix owl: . @prefix vitro: . @prefix dynapi: . -@prefix dynapi_java: . +@prefix dynapi_java: . @prefix xsd: . ############################################### @@ -120,14 +120,14 @@ a dynapi:Procedure ; - rdfs:label "Create a OU"@en-US ; + rdfs:label "Create an OU"@en-US ; dynapi:accessWhitelist ; dynapi:hasFirstStep ; dynapi:providesParameter . a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 1"@en-US ; + rdfs:label "creation of an OU step 1"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -140,7 +140,7 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 2"@en-US ; + rdfs:label "creation of an OU step 2"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -153,7 +153,7 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 3"@en-US ; + rdfs:label "creation of an OU step 3"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -166,7 +166,7 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 4"@en-US ; + rdfs:label "creation of an OU step 4"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -190,7 +190,7 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 5"@en-US ; + rdfs:label "creation of an OU step 5"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -198,7 +198,7 @@ a dynapi:ConditionalStep ; rdfs:label "conditional step for super OU name check"@en-US ; dynapi:nextIfSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; @@ -207,7 +207,7 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 6"@en-US ; + rdfs:label "creation of an OU step 6"@en-US ; dynapi:hasOperation . @@ -294,14 +294,14 @@ a dynapi:Procedure ; - rdfs:label "Fetching a OU"@en-US ; + rdfs:label "Fetching an OU"@en-US ; dynapi:accessWhitelist ; dynapi:providesParameter ; dynapi:hasFirstStep . a dynapi:OperationalStep ; - rdfs:label "reading of a OU"@en-US ; + rdfs:label "reading of an OU"@en-US ; dynapi:hasOperation . @@ -312,17 +312,21 @@ dynapi:providesParameter ; dynapi:sparqlQueryText """ - SELECT ?uri ?type ?name ?description ?superOrganizationUnitUri ?superOrganizationUnitName + 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 ?type } - OPTIONAL { ?uri ?name } - OPTIONAL { ?uri ?description } - OPTIONAL { ?uri ?superOrganizationUnitUri } - OPTIONAL { ?uri ?superOrganizationUnitName } - FILTER (?uri = ?resource_id) + OPTIONAL { ?uri ?typeOptional } + OPTIONAL { ?uri ?nameOptional } + OPTIONAL { ?uri ?descriptionOptional } + OPTIONAL { ?uri ?superOrganizationUnitUriOptional } + OPTIONAL { ?uri ?superOrganizationUnitNameOptional } + FILTER( ?uri = ?resource_id) } - LIMIT 1 OFFSET 1 + GROUP BY ?uri """ . ############################################### @@ -331,7 +335,7 @@ a dynapi:Procedure ; - rdfs:label "Deleting a OU"@en-US ; + rdfs:label "Deleting an OU"@en-US ; dynapi:accessWhitelist ; dynapi:hasFirstStep . @@ -425,7 +429,7 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 1"@en-US ; + rdfs:label "creation of an OU step 1"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -438,9 +442,9 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 2"@en-US ; + rdfs:label "creation of an OU step 2"@en-US ; dynapi:hasOperation ; - dynapi:hasNextStep . + dynapi:hasNextStep . a dynapi:ConditionalStep ; @@ -451,7 +455,7 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 3"@en-US ; + rdfs:label "creation of an OU step 3"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -464,7 +468,7 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 4"@en-US ; + rdfs:label "creation of an OU step 4"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -488,7 +492,7 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 5"@en-US ; + rdfs:label "creation of an OU step 5"@en-US ; dynapi:hasOperation ; dynapi:hasNextStep . @@ -496,7 +500,7 @@ a dynapi:ConditionalStep ; rdfs:label "conditional step for super OU name check"@en-US ; dynapi:nextIfSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; @@ -505,7 +509,7 @@ a dynapi:OperationalStep ; - rdfs:label "creation of a OU step 6"@en-US ; + rdfs:label "creation of an OU step 6"@en-US ; dynapi:hasOperation . ############################################### @@ -704,7 +708,7 @@ dynapi:targetContainer ; dynapi:requiresParameter . - + a dynapi:ConditionContainerContains ; dynapi:targetContainer ; dynapi:requiresParameter . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 index b536f0302..b27d23277 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 @@ -770,8 +770,7 @@ dynapi:providesParameter ; dynapi:sparqlQueryText """ - SELECT ?uri - (SAMPLE(?personType) as ?type) + SELECT ?uri (GROUP_CONCAT(DISTINCT ?personType; separator=" -> ") as ?type) (SAMPLE(?personlabel) as ?label) (SAMPLE(?firstName) as ?first_name) (SAMPLE(?middleName) as ?middle_name) diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_event.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_event.n3 new file mode 100644 index 000000000..d07e7a94e --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_event.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/enpoint_procedure_CRUD_event.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/enpoint_procedure_CRUD_event.n3 new file mode 100644 index 000000000..58a30a508 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/enpoint_procedure_CRUD_event.n3 @@ -0,0 +1,720 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY CREATION +############################################### + + + a dynapi:N3Template ; + rdfs:label "create event N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?uri ; + """ . + + + a dynapi:N3Template ; + rdfs:label "create event type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?type . " . + + + a dynapi:N3Template ; + rdfs:label "create event name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?name . " . + + + a dynapi:N3Template ; + rdfs:label "create event abbreviation N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?abbreviation . " . + + + a dynapi:N3Template ; + rdfs:label "create event startDate N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?startDate . " . + + + a dynapi:N3Template ; + rdfs:label "create event endDate N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?endDate . " . + + + a dynapi:N3Template ; + rdfs:label "create event place N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?place . " . + + + a dynapi:N3Template ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?venueURI ; + ?venueName . + + ?uri ?venueURI . + """ . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY UPDATE +############################################### + + + a dynapi:N3Template ; + rdfs:label "create event N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?resource_id ; + """ . + + + a dynapi:N3Template ; + rdfs:label "create event type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?type . " . + + + a dynapi:N3Template ; + rdfs:label "create event name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?name . " . + + + a dynapi:N3Template ; + rdfs:label "create event abbreviation N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?abbreviation . " . + + + a dynapi:N3Template ; + rdfs:label "create event startDate N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?startDate . " . + + + a dynapi:N3Template ; + rdfs:label "create event endDate N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?endDate . " . + + + a dynapi:N3Template ; + rdfs:label "create event place N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?place . " . + + + a dynapi:N3Template ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?venueURI ; + ?venueName . + + ?resource_id ?venueURI . + """ . + +############################################### +### CREATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Create an event"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event type check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event abbreviation check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event startDate check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event endDate check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 6"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event place check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an event step 7"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event venue check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for event venue name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + +############################################### +### READ (all) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching OUs"@en-US ; + dynapi:accessWhitelist ; + dynapi:providesParameter ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "fetch events step"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read events sparql query"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + 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 + """ . + + + a dynapi:OperationalStep ; + rdfs:label "number of events step "@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "number of events sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; + dynapi:sparqlQueryText + """ + SELECT (count(distinct ?uri) as ?count) + WHERE + { + ?uri + } + """ . + +############################################### +### READ (one) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching an event"@en-US ; + dynapi:accessWhitelist ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "reading of an event"@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read event sparql query"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:providesParameter ; + 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 + """ . + +############################################### +### DELETE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Deleting a OU"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + 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 ; + dynapi:requiresParameter ; + dynapi:hasModel . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + +########################## +## Unpacking operations ## +########################## + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + +############################################### +### PARAMETERS +############################################### + +#################### +## Event response ## +#################### + + + a dynapi:Parameter ; + rdfs:label "events"@en-US ; + dynapi:name "events" ; + dynapi:description "List of available events and statistics (number)" ; + dynapi:hasType . + + + a dynapi:Parameter ; + rdfs:label "Number of fetched events"@en-US ; + dynapi:name "count" ; + dynapi:hasType . + +##################### +## Creation fields ## +##################### + + + 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 . + + + a dynapi:Parameter ; + dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "abbreviation" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "startDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "endDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "place" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "eventVenue" ; + dynapi:defaultValue "{}" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + 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 . + + + a dynapi:Parameter ; + dynapi:name "venueName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + +# Event Venue keys + + + a dynapi:Parameter ; + dynapi:name "eventVenueName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "name" ; + dynapi:hasType . + +######################### +## Read request fields ## +######################### + + + a dynapi:Parameter ; + dynapi:name "resource_id" ; + dynapi:hasType ; + rdfs:label "resource uri"@en-US . + + + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType ; + rdfs:label "total"@en-US . + + + a dynapi:parameter ; + dynapi:name "limit" ; + dynapi:defaultValue "20" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "limit"@en-US . + + + a dynapi:parameter ; + dynapi:name "offset" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "offset"@en-US . + + + a dynapi:parameter ; + dynapi:name "sortBy" ; + dynapi:defaultValue "label" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "sortBy"@en-US . + + + a dynapi:parameter ; + dynapi:name "order" ; + dynapi:defaultValue "ASC" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "order"@en-US . + +########################### +## Delete request fields ## +########################### + + + a dynapi:Model ; + dynapi:name "event_graph" ; + dynapi:hasType . + +############################################### +### PARAMETER CHECKS +############################################### + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event type is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event abbreviation is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event startDate is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event endDate is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event place is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event venue is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + +############################################### +### ACCESS CONTROL +############################################### + + + a dynapi:GroupAccessWhitelist ; + dynapi:userGroup . From 4cd1e6b1cce6aad691cc4068601cef6e6a1b48d5 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 11 Sep 2023 19:36:13 +0200 Subject: [PATCH 32/38] Refactored .n3 files. --- .../endpoint_procedure_create_event.n3 | 210 +++ .../endpoint_procedure_delete_event.n3 | 87 + .../endpoint_procedure_read_all_events.n3 | 89 + .../endpoint_procedure_read_event.n3 | 59 + .../enpoint_procedure_update_event.n3 | 89 + .../resource/endpoint_resource_event_API.n3 | 15 + .../endpoint_resource_event_parameters.n3 | 181 ++ .../resource/endpoint_resource_event_utils.n3 | 69 + ...dpoint_procedure_CRUD_organisation_unit.n3 | 722 ++++++++ ...ndpoint_resource_CRUD_organisation_unit.n3 | 15 + .../person/endpoint_procedure_CRUD_person.n3 | 1498 +++++++++++++++++ .../person/endpoint_resource_CRUD_person.n3 | 15 + 12 files changed, 3049 insertions(+) create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_create_event.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_delete_event.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_read_all_events.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_read_event.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/enpoint_procedure_update_event.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_API.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_parameters.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_utils.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_procedure_CRUD_organisation_unit.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_resource_CRUD_organisation_unit.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_procedure_CRUD_person.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_resource_CRUD_person.n3 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..2b7040e44 --- /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:abox_assertions . + +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..ed907c25e --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_read_all_events.n3 @@ -0,0 +1,89 @@ +@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 read_parameter: . + +############################################### +### READ (all) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching OUs"@en-US ; + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:providesParameter read_parameter:events ; + dynapi:providesParameter read_parameter: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 read_parameter:events ; + dynapi:requiresPlainParameter read_parameter:limit ; + dynapi:requiresPlainParameter read_parameter:offset ; + dynapi:requiresPlainParameter read_parameter:sortBy ; + dynapi:requiresPlainParameter read_parameter: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 read_parameter: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..7ed5f6604 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/procedure/endpoint_procedure_read_event.n3 @@ -0,0 +1,59 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################### +### READ (one) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching an event"@en-US ; + dynapi:accessWhitelist ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "reading of an event"@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read event sparql query"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:providesParameter ; + 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..5052927d6 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_parameters.n3 @@ -0,0 +1,181 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . +@prefix dynapi_type: . + +############################################### +### PARAMETERS +############################################### + +#################### +## Event response ## +#################### + + + 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 . + + + a dynapi:Parameter ; + rdfs:label "Number of fetched events"@en-US ; + dynapi:name "count" ; + dynapi:hasType dynapi_type:JsonContainer . + +##################### +## Creation fields ## +##################### + + + 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 . + + + a dynapi:Parameter ; + dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:uri . + + + a dynapi:Parameter ; + dynapi:name "name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + + + a dynapi:Parameter ; + dynapi:name "abbreviation" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + + + a dynapi:Parameter ; + dynapi:name "startDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + + + a dynapi:Parameter ; + dynapi:name "endDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + + + a dynapi:Parameter ; + dynapi:name "place" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:string-literal . + + + a dynapi:Parameter ; + dynapi:name "eventVenue" ; + dynapi:defaultValue "{}" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType dynapi_type:JsonContainer . + + + 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 . + + + 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 + + + a dynapi:Parameter ; + dynapi:name "eventVenueName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "name" ; + dynapi:hasType dynapi_type:string . + +######################### +## Read request fields ## +######################### + + + a dynapi:Parameter ; + dynapi:name "resource_id" ; + dynapi:hasType dynapi_type:uri ; + rdfs:label "resource uri"@en-US . + + + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType dynapi_type:integer ; + rdfs:label "total"@en-US . + + + 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 . + + + 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 . + + + 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 . + + + 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 ## +########################### + + + 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..c32a25577 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/event/resource/endpoint_resource_event_utils.n3 @@ -0,0 +1,69 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +########################## +## Unpacking operations ## +########################## + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + +############################################### +### PARAMETER CHECKS +############################################### + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event type is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event abbreviation is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event startDate is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event endDate is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event place is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if event venue is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + +############################################### +### ACCESS CONTROL +############################################### + + + a dynapi:GroupAccessWhitelist ; + dynapi:userGroup . \ No newline at end of file diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_procedure_CRUD_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_procedure_CRUD_organisation_unit.n3 new file mode 100644 index 000000000..62afc0370 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_procedure_CRUD_organisation_unit.n3 @@ -0,0 +1,722 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY CREATION +############################################### + + + a dynapi:N3Template ; + rdfs:label "create OU N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?uri ; + """ . + + + a dynapi:N3Template ; + rdfs:label "create OU type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?type . " . + + + a dynapi:N3Template ; + rdfs:label "create OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?name . " . + + + a dynapi:N3Template ; + rdfs:label "create OU description N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?description . " . + + + a dynapi:N3Template ; + rdfs:label "create super OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?superURI . " . + + + a dynapi:N3Template ; + rdfs:label "create super OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?superName . " . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY UPDATE +############################################### + + + a dynapi:N3Template ; + rdfs:label "update OU N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?resource_id ; + """ . + + + a dynapi:N3Template ; + rdfs:label "update OU type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?type . " . + + + a dynapi:N3Template ; + rdfs:label "update OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?name . " . + + + a dynapi:N3Template ; + rdfs:label "update OU description N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?description . " . + + + a dynapi:N3Template ; + rdfs:label "update super OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?superURI . " . + + + a dynapi:N3Template ; + rdfs:label "update super OU name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?superName . " . + +############################################### +### CREATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Create an OU"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU type check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU description check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU URI check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 6"@en-US ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + +############################################### +### READ (all) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching OUs"@en-US ; + dynapi:accessWhitelist ; + dynapi:providesParameter ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "fetch OUs step"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read OUs sparql query"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + 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 + """ . + + + a dynapi:OperationalStep ; + rdfs:label "number of OUs step "@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "number of OUs sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; + dynapi:sparqlQueryText + """ + SELECT (count(distinct ?uri) as ?count) + WHERE + { + ?uri + } + """ . + +############################################### +### READ (one) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching an OU"@en-US ; + dynapi:accessWhitelist ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "reading of an OU"@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read OU sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:providesParameter ; + 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 + """ . + +############################################### +### DELETE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Deleting an OU"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + 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 ; + dynapi:requiresParameter ; + dynapi:hasModel . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + +############################################### +### UPDATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Updating a OU"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU type check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for OU description check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU URI check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for super OU name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + rdfs:label "creation of an OU step 6"@en-US ; + dynapi:hasOperation . + +############################################### +### PARAMETERS +############################################### + +################################ +## Organization unit response ## +################################ + + + a dynapi:Parameter ; + rdfs:label "organizationUnits"@en-US ; + dynapi:name "organizationUnits" ; + dynapi:description "List of available OUs and statistics (number)" ; + dynapi:hasType . + + + a dynapi:Parameter ; + rdfs:label "Number of fetched OUs"@en-US ; + dynapi:name "count" ; + dynapi:hasType . + +##################### +## Creation fields ## +##################### + + + 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 . + + + a dynapi:Parameter ; + dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "description" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "superURI" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "superName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "superOrganizationUnit" ; + dynapi:defaultValue "{}" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + +# Super Organisation Unit keys + + + a dynapi:Parameter ; + dynapi:name "superOrganizationUnitURI_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "uri" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "superOrganizationUnitName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "name" ; + dynapi:hasType . + +######################### +## Read request fields ## +######################### + + + a dynapi:Parameter ; + dynapi:name "resource_id" ; + dynapi:hasType ; + rdfs:label "resource uri"@en-US . + + + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType ; + rdfs:label "total"@en-US . + + + a dynapi:parameter ; + dynapi:name "limit" ; + dynapi:defaultValue "20" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "limit"@en-US . + + + a dynapi:parameter ; + dynapi:name "offset" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "offset"@en-US . + + + a dynapi:parameter ; + dynapi:name "sortBy" ; + dynapi:defaultValue "label" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "sortBy"@en-US . + + + a dynapi:parameter ; + dynapi:name "order" ; + dynapi:defaultValue "ASC" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "order"@en-US . + +########################### +## Delete request fields ## +########################### + + + a dynapi:Model ; + dynapi:name "organization_unit_graph" ; + dynapi:hasType . + +############################################### +### PARAMETER CHECKS +############################################### + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if OU type is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if OU name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if OU description is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if super OU is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if super OU name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if super OU is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + +############################################### +### ACCESS CONTROL +############################################### + + + a dynapi:GroupAccessWhitelist ; + dynapi:userGroup . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_resource_CRUD_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_resource_CRUD_organisation_unit.n3 new file mode 100644 index 000000000..8d1189ed7 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_resource_CRUD_organisation_unit.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/person/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_procedure_CRUD_person.n3 new file mode 100644 index 000000000..b27d23277 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_procedure_CRUD_person.n3 @@ -0,0 +1,1498 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY CREATION +############################################### + + + a dynapi:N3Template ; + rdfs:label "create person N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?uri ; + ?label . + """ . + + + a dynapi:N3Template ; + rdfs:label "create person first name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?first_name . " . + + + a dynapi:N3Template ; + rdfs:label "create person middle name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?middle_name . " . + + + a dynapi:N3Template ; + rdfs:label "create person last name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?last_name . " . + + + a dynapi:N3Template ; + rdfs:label "create person type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?type . " . + + + a dynapi:N3Template ; + rdfs:label "create person internal id N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?internalID . " . + + + a dynapi:N3Template ; + rdfs:label "create person ORCID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?ORCID . " . + + + a dynapi:N3Template ; + rdfs:label "create person SCOPUS author ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?SCOPUSAuthorID . " . + + + a dynapi:N3Template ; + rdfs:label "create person researcher ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?uri ?ResearcherID . " . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY UPDATE +############################################### + + + a dynapi:N3Template ; + rdfs:label "update person N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?resource_id ; + ?label . + """ . + + + a dynapi:N3Template ; + rdfs:label "update person first name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?first_name . " . + + + a dynapi:N3Template ; + rdfs:label "update person middle name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?middle_name . " . + + + a dynapi:N3Template ; + rdfs:label "update person last name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?last_name . " . + + + a dynapi:N3Template ; + rdfs:label "update person type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?type . " . + + + a dynapi:N3Template ; + rdfs:label "update person internal id N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?internalID . " . + + + a dynapi:N3Template ; + rdfs:label "update person ORCID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?ORCID . " . + + + a dynapi:N3Template ; + rdfs:label "update person SCOPUS author ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?SCOPUSAuthorID . " . + + + a dynapi:N3Template ; + rdfs:label "update person researcher ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?ResearcherID . " . + +############################################### +### CREATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Create a person"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person middle name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person last name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person type check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person internal id check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 6"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person ORCID check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 7"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 8"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person researcher ID check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 9"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person positions check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:ParameterSubstitution ; + dynapi:substitutionSource ; + dynapi:substitutionTarget . + + + a dynapi:OperationalStep ; + dynapi:hasParameterSubstitution ; + dynapi:hasOperation ; + rdfs:label "Create provided person positions"@en-US . + +## Loop start + + + a dynapi:LoopOperation ; + #get positions from array + dynapi:inputDescriptor ; + dynapi:conditionDescriptor ; + + dynapi:outputDescriptor ; + dynapi:executableDescriptor ; + + dynapi:internalParameter ; + + dynapi:internalParameter ; + dynapi:providesParameter . + + + a dynapi:ProcedureDescriptor ; + dynapi:providesParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . + + + a dynapi:ProcedureDescriptor ; + dynapi:providesParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . + + + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter ; + dynapi:providesParameter ; + dynapi:call . + + + a dynapi:Procedure ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:SumOperation ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . + +## Loop end + +############################################################ +#Get position from a container + + + a dynapi:Procedure ; + dynapi:hasFirstStep ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:providesParameter ; + dynapi:targetContainer ; + dynapi:requiresParameter . + +############################################################ +#Condition procedure + + + a dynapi:Procedure ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:SumOperation ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + +############################################################ +#Add person position construct query + + + a dynapi:Procedure ; + dynapi:hasFirstStep . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:N3Template ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?current_step_uri ; + ?positionType ; + ?positionName ; + ?organizationUnitName ; + ?organizationUnitURI ; + ?startDate ; + ?endDate . + + """ . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:N3Template ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?current_uri_persisted ?current_step_uri . + + """ . + +############################################################ +#Update person position construct query + + + a dynapi:Procedure ; + dynapi:hasFirstStep . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + +############################################### +### READ (all) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching persons"@en-US ; + dynapi:accessWhitelist ; + dynapi:providesParameter ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "fetch persons step"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read persons sparql query"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + 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(?positionName), STR(?positionName), ''), + '", "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 + + """ . + + + a dynapi:OperationalStep ; + rdfs:label "number of persons step "@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "number of persons sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:providesParameter ; + dynapi:sparqlQueryText + """ + SELECT (count(distinct ?uri) as ?count) + WHERE + { + ?uri + } + """ . + +############################################### +### READ (one) +############################################### + + + a dynapi:Procedure ; + rdfs:label "Fetching a person"@en-US ; + dynapi:accessWhitelist ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + rdfs:label "reading of a person"@en-US ; + dynapi:hasOperation . + + + a dynapi:SparqlSelectQuery ; + rdfs:label "read person sparql query 1"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:providesParameter ; + 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(?positionName), STR(?positionName), ''), + '", "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 + """ . + +############################################### +### DELETE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Deleting a person"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + 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 ; + dynapi:requiresParameter ; + dynapi:hasModel . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + +############################################### +### UPDATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Updating a person"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person middle name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person last name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person type check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person internal id check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 6"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person ORCID check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 7"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 8"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 9"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person positions check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:ParameterSubstitution ; + dynapi:substitutionSource ; + dynapi:substitutionTarget . + + + a dynapi:OperationalStep ; + dynapi:hasParameterSubstitution ; + dynapi:hasOperation ; + rdfs:label "Create provided person positions"@en-US . + + + a dynapi:LoopOperation ; + dynapi:inputDescriptor ; + dynapi:conditionDescriptor ; + + dynapi:outputDescriptor ; + dynapi:executableDescriptor ; + + dynapi:internalParameter ; + + dynapi:internalParameter ; + dynapi:providesParameter . + + + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . + +############################################### +### PARAMETERS +############################################### + +##################### +## Person response ## +##################### + + + a dynapi:Parameter ; + rdfs:label "persons"@en-US ; + dynapi:name "persons" ; + dynapi:description "List of available persons and statistics (number)" ; + dynapi:hasType . + + + a dynapi:Parameter ; + rdfs:label "Number of fetched persons"@en-US ; + dynapi:name "count" ; + dynapi:hasType . + +###################### +## Iteration params ## +###################### + + + a dynapi:Parameter ; + dynapi:name "iteration_param" ; + dynapi:defaultValue "0" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "int_1" ; + dynapi:defaultValue "1" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "condition_result" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "condition_result" ; + dynapi:defaultValue "1" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "int_1" ; + dynapi:defaultValue "1" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + + + 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 . + +##################### +## Creation fields ## +##################### + + + a dynapi:Parameter ; + dynapi:name "current_uri_persisted" ; + dynapi:hasType . + + + 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 . + + + a dynapi:Parameter ; + dynapi:name "label" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "first_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "middle_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "last_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positions" ; + dynapi:defaultValue "[]" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "internalID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "ORCID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "SCOPUSAuthorID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "ResearcherID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "item" ; + dynapi:hasType . + +######################### +## Read request fields ## +######################### + + + a dynapi:Parameter ; + dynapi:name "resource_id" ; + dynapi:hasType ; + rdfs:label "resource uri"@en-US . + + + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType ; + rdfs:label "total"@en-US . + + + a dynapi:parameter ; + dynapi:name "limit" ; + dynapi:defaultValue "20" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "limit"@en-US . + + + a dynapi:parameter ; + dynapi:name "offset" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "offset"@en-US . + + + a dynapi:parameter ; + dynapi:name "sortBy" ; + dynapi:defaultValue "label" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "sortBy"@en-US . + + + a dynapi:parameter ; + dynapi:name "order" ; + dynapi:defaultValue "ASC" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "order"@en-US . + +########################### +## Delete request fields ## +########################### + + + a dynapi:Model ; + dynapi:name "person_graph" ; + dynapi:hasType . + +############################################### +### POSITION FIELDS +############################################### + +# Internal + + + a dynapi:Parameter ; + dynapi:name "organizationUnitURI_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "organizationUnitURI" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "organizationUnitName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "organizationUnitName" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "positionName" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionType_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "positionType" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "startDate_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "startDate" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "endDate_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "endDate" ; + dynapi:hasType . + +# Provided + + + a dynapi:Parameter ; + dynapi:name "organizationUnitURI" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "organizationUnitName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionType" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "startDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "endDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + +############################################### +### PARAMETER CHECKS +############################################### + +# Person attributes + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person first name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person middle name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person last name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person type is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person internal ID is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person ORCID is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person SCOPUS author id is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person researcher ID is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person positions are defined"@en-US ; + dynapi:requiresParameter . + +# Person position container keys + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + +############################################### +### ACCESS CONTROL +############################################### + + + a dynapi:GroupAccessWhitelist ; + dynapi:userGroup . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_resource_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_resource_CRUD_person.n3 new file mode 100644 index 000000000..972bf9e2f --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_resource_CRUD_person.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 From 6c88b7c2a7cbe55a510662f91aff898d7b0bc623 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Tue, 12 Sep 2023 17:22:26 +0200 Subject: [PATCH 33/38] Removed old implementations, refactored OU related files. --- ...dpoint_procedure_CRUD_organisation_unit.n3 | 722 -------- .../endpoint_procedure_CRUD_person.n3 | 1498 ----------------- .../everytime/endpoint_resource_CRUD_event.n3 | 15 - .../endpoint_resource_CRUD_person.n3 | 15 - .../everytime/enpoint_procedure_CRUD_event.n3 | 720 -------- .../endpoint_procedure_read_all_events.n3 | 19 +- .../endpoint_procedure_read_event.n3 | 23 +- .../endpoint_resource_event_parameters.n3 | 42 +- .../resource/endpoint_resource_event_utils.n3 | 48 +- ...dpoint_procedure_CRUD_organisation_unit.n3 | 722 -------- ...ndpoint_resource_CRUD_organisation_unit.n3 | 15 - ...oint_procedure_create_organisation_unit.n3 | 176 ++ ...oint_procedure_delete_organisation_unit.n3 | 75 + ...t_procedure_read_all_organisation_units.n3 | 78 + ...dpoint_procedure_read_organisation_unit.n3 | 52 + ...oint_procedure_update_organisation_unit.n3 | 191 +++ ...ndpoint_resource_organisation_unit_API.n3} | 0 ...t_resource_organisation_unit_parameters.n3 | 168 ++ ...dpoint_resource_organisation_unit_utils.n3 | 62 + 19 files changed, 874 insertions(+), 3767 deletions(-) delete mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 delete mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 delete mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_event.n3 delete mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 delete mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/enpoint_procedure_CRUD_event.n3 delete mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_procedure_CRUD_organisation_unit.n3 delete mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_resource_CRUD_organisation_unit.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_create_organisation_unit.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_delete_organisation_unit.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_read_all_organisation_units.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_read_organisation_unit.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_update_organisation_unit.n3 rename home/src/main/resources/rdf/dynapiAbox/everytime/{endpoint_resource_CRUD_organisation_unit.n3 => organization_unit/resource/endpoint_resource_organisation_unit_API.n3} (100%) create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_parameters.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_utils.n3 diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 deleted file mode 100644 index 62afc0370..000000000 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_organisation_unit.n3 +++ /dev/null @@ -1,722 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix vitro: . -@prefix dynapi: . -@prefix dynapi_java: . -@prefix xsd: . - -############################################### -### N3 TEMPLATE PARTIAL ENTITY CREATION -############################################### - - - a dynapi:N3Template ; - rdfs:label "create OU N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?uri ; - """ . - - - a dynapi:N3Template ; - rdfs:label "create OU type N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?type . " . - - - a dynapi:N3Template ; - rdfs:label "create OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?name . " . - - - a dynapi:N3Template ; - rdfs:label "create OU description N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?description . " . - - - a dynapi:N3Template ; - rdfs:label "create super OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?superURI . " . - - - a dynapi:N3Template ; - rdfs:label "create super OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?superName . " . - -############################################### -### N3 TEMPLATE PARTIAL ENTITY UPDATE -############################################### - - - a dynapi:N3Template ; - rdfs:label "update OU N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?resource_id ; - """ . - - - a dynapi:N3Template ; - rdfs:label "update OU type N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?type . " . - - - a dynapi:N3Template ; - rdfs:label "update OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?name . " . - - - a dynapi:N3Template ; - rdfs:label "update OU description N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?description . " . - - - a dynapi:N3Template ; - rdfs:label "update super OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?superURI . " . - - - a dynapi:N3Template ; - rdfs:label "update super OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?superName . " . - -############################################### -### CREATE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Create an OU"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep ; - dynapi:providesParameter . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU type check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU description check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU URI check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 6"@en-US ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - -############################################### -### READ (all) -############################################### - - - a dynapi:Procedure ; - rdfs:label "Fetching OUs"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "fetch OUs step"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "read OUs sparql query"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - 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 - """ . - - - a dynapi:OperationalStep ; - rdfs:label "number of OUs step "@en-US ; - dynapi:hasOperation . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "number of OUs sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; - dynapi:sparqlQueryText - """ - SELECT (count(distinct ?uri) as ?count) - WHERE - { - ?uri - } - """ . - -############################################### -### READ (one) -############################################### - - - a dynapi:Procedure ; - rdfs:label "Fetching an OU"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "reading of an OU"@en-US ; - dynapi:hasOperation . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "read OU sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:providesParameter ; - 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 - """ . - -############################################### -### DELETE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Deleting an OU"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - 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 ; - dynapi:requiresParameter ; - dynapi:hasModel . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ModelWriter ; - dynapi:retractionModel ; - dynapi:targetModel . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:ProcedurePoolAtomicOperation ; - dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . - -############################################### -### UPDATE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Updating a OU"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ModelWriter ; - dynapi:retractionModel ; - dynapi:targetModel . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ProcedurePoolAtomicOperation ; - dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU type check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU description check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU URI check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 6"@en-US ; - dynapi:hasOperation . - -############################################### -### PARAMETERS -############################################### - -################################ -## Organization unit response ## -################################ - - - a dynapi:Parameter ; - rdfs:label "organizationUnits"@en-US ; - dynapi:name "organizationUnits" ; - dynapi:description "List of available OUs and statistics (number)" ; - dynapi:hasType . - - - a dynapi:Parameter ; - rdfs:label "Number of fetched OUs"@en-US ; - dynapi:name "count" ; - dynapi:hasType . - -##################### -## Creation fields ## -##################### - - - 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 . - - - a dynapi:Parameter ; - dynapi:name "type" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "description" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "superURI" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "superName" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "superOrganizationUnit" ; - dynapi:defaultValue "{}" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - -# Super Organisation Unit keys - - - a dynapi:Parameter ; - dynapi:name "superOrganizationUnitURI_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "uri" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "superOrganizationUnitName_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "name" ; - dynapi:hasType . - -######################### -## Read request fields ## -######################### - - - a dynapi:Parameter ; - dynapi:name "resource_id" ; - dynapi:hasType ; - rdfs:label "resource uri"@en-US . - - - a dynapi:parameter ; - dynapi:name "total" ; - dynapi:hasType ; - rdfs:label "total"@en-US . - - - a dynapi:parameter ; - dynapi:name "limit" ; - dynapi:defaultValue "20" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "limit"@en-US . - - - a dynapi:parameter ; - dynapi:name "offset" ; - dynapi:defaultValue "0" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "offset"@en-US . - - - a dynapi:parameter ; - dynapi:name "sortBy" ; - dynapi:defaultValue "label" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "sortBy"@en-US . - - - a dynapi:parameter ; - dynapi:name "order" ; - dynapi:defaultValue "ASC" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "order"@en-US . - -########################### -## Delete request fields ## -########################### - - - a dynapi:Model ; - dynapi:name "organization_unit_graph" ; - dynapi:hasType . - -############################################### -### PARAMETER CHECKS -############################################### - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if OU type is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if OU name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if OU description is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if super OU is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if super OU name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if super OU is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - -############################################### -### ACCESS CONTROL -############################################### - - - a dynapi:GroupAccessWhitelist ; - dynapi:userGroup . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 deleted file mode 100644 index b27d23277..000000000 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_procedure_CRUD_person.n3 +++ /dev/null @@ -1,1498 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix vitro: . -@prefix dynapi: . -@prefix dynapi_java: . -@prefix xsd: . - -############################################### -### N3 TEMPLATE PARTIAL ENTITY CREATION -############################################### - - - a dynapi:N3Template ; - rdfs:label "create person N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?uri ; - ?label . - """ . - - - a dynapi:N3Template ; - rdfs:label "create person first name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?first_name . " . - - - a dynapi:N3Template ; - rdfs:label "create person middle name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?middle_name . " . - - - a dynapi:N3Template ; - rdfs:label "create person last name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?last_name . " . - - - a dynapi:N3Template ; - rdfs:label "create person type N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?type . " . - - - a dynapi:N3Template ; - rdfs:label "create person internal id N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?internalID . " . - - - a dynapi:N3Template ; - rdfs:label "create person ORCID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?ORCID . " . - - - a dynapi:N3Template ; - rdfs:label "create person SCOPUS author ID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?SCOPUSAuthorID . " . - - - a dynapi:N3Template ; - rdfs:label "create person researcher ID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?ResearcherID . " . - -############################################### -### N3 TEMPLATE PARTIAL ENTITY UPDATE -############################################### - - - a dynapi:N3Template ; - rdfs:label "update person N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?resource_id ; - ?label . - """ . - - - a dynapi:N3Template ; - rdfs:label "update person first name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?first_name . " . - - - a dynapi:N3Template ; - rdfs:label "update person middle name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?middle_name . " . - - - a dynapi:N3Template ; - rdfs:label "update person last name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?last_name . " . - - - a dynapi:N3Template ; - rdfs:label "update person type N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?type . " . - - - a dynapi:N3Template ; - rdfs:label "update person internal id N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?internalID . " . - - - a dynapi:N3Template ; - rdfs:label "update person ORCID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?ORCID . " . - - - a dynapi:N3Template ; - rdfs:label "update person SCOPUS author ID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?SCOPUSAuthorID . " . - - - a dynapi:N3Template ; - rdfs:label "update person researcher ID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?ResearcherID . " . - -############################################### -### CREATE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Create a person"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep ; - dynapi:providesParameter . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person middle name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person last name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person type check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person internal id check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 6"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person ORCID check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 7"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 8"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person researcher ID check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 9"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person positions check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:ParameterSubstitution ; - dynapi:substitutionSource ; - dynapi:substitutionTarget . - - - a dynapi:OperationalStep ; - dynapi:hasParameterSubstitution ; - dynapi:hasOperation ; - rdfs:label "Create provided person positions"@en-US . - -## Loop start - - - a dynapi:LoopOperation ; - #get positions from array - dynapi:inputDescriptor ; - dynapi:conditionDescriptor ; - - dynapi:outputDescriptor ; - dynapi:executableDescriptor ; - - dynapi:internalParameter ; - - dynapi:internalParameter ; - dynapi:providesParameter . - - - a dynapi:ProcedureDescriptor ; - dynapi:providesParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . - - - a dynapi:ProcedureDescriptor ; - dynapi:providesParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . - - - a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:providesParameter ; - dynapi:call . - - - a dynapi:Procedure ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:SumOperation ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . - -## Loop end - -############################################################ -#Get position from a container - - - a dynapi:Procedure ; - dynapi:hasFirstStep ; - dynapi:providesParameter . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:providesParameter ; - dynapi:targetContainer ; - dynapi:requiresParameter . - -############################################################ -#Condition procedure - - - a dynapi:Procedure ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:SumOperation ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - -############################################################ -#Add person position construct query - - - a dynapi:Procedure ; - dynapi:hasFirstStep . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:N3Template ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - @prefix dynapi: . - @prefix rdfs: . - - ?current_step_uri ; - ?positionType ; - ?positionName ; - ?organizationUnitName ; - ?organizationUnitURI ; - ?startDate ; - ?endDate . - - """ . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:N3Template ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - @prefix dynapi: . - @prefix rdfs: . - - ?current_uri_persisted ?current_step_uri . - - """ . - -############################################################ -#Update person position construct query - - - a dynapi:Procedure ; - dynapi:hasFirstStep . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - -############################################### -### READ (all) -############################################### - - - a dynapi:Procedure ; - rdfs:label "Fetching persons"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "fetch persons step"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "read persons sparql query"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - 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(?positionName), STR(?positionName), ''), - '", "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 - - """ . - - - a dynapi:OperationalStep ; - rdfs:label "number of persons step "@en-US ; - dynapi:hasOperation . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "number of persons sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; - dynapi:sparqlQueryText - """ - SELECT (count(distinct ?uri) as ?count) - WHERE - { - ?uri - } - """ . - -############################################### -### READ (one) -############################################### - - - a dynapi:Procedure ; - rdfs:label "Fetching a person"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "reading of a person"@en-US ; - dynapi:hasOperation . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "read person sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:providesParameter ; - 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(?positionName), STR(?positionName), ''), - '", "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 - """ . - -############################################### -### DELETE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Deleting a person"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - 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 ; - dynapi:requiresParameter ; - dynapi:hasModel . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ModelWriter ; - dynapi:retractionModel ; - dynapi:targetModel . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:ProcedurePoolAtomicOperation ; - dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . - -############################################### -### UPDATE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Updating a person"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ModelWriter ; - dynapi:retractionModel ; - dynapi:targetModel . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ProcedurePoolAtomicOperation ; - dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person middle name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person last name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person type check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person internal id check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 6"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person ORCID check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 7"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 8"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 9"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person positions check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:ParameterSubstitution ; - dynapi:substitutionSource ; - dynapi:substitutionTarget . - - - a dynapi:OperationalStep ; - dynapi:hasParameterSubstitution ; - dynapi:hasOperation ; - rdfs:label "Create provided person positions"@en-US . - - - a dynapi:LoopOperation ; - dynapi:inputDescriptor ; - dynapi:conditionDescriptor ; - - dynapi:outputDescriptor ; - dynapi:executableDescriptor ; - - dynapi:internalParameter ; - - dynapi:internalParameter ; - dynapi:providesParameter . - - - a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . - -############################################### -### PARAMETERS -############################################### - -##################### -## Person response ## -##################### - - - a dynapi:Parameter ; - rdfs:label "persons"@en-US ; - dynapi:name "persons" ; - dynapi:description "List of available persons and statistics (number)" ; - dynapi:hasType . - - - a dynapi:Parameter ; - rdfs:label "Number of fetched persons"@en-US ; - dynapi:name "count" ; - dynapi:hasType . - -###################### -## Iteration params ## -###################### - - - a dynapi:Parameter ; - dynapi:name "iteration_param" ; - dynapi:defaultValue "0" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "int_1" ; - dynapi:defaultValue "1" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "condition_result" ; - dynapi:defaultValue "0" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "condition_result" ; - dynapi:defaultValue "1" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "int_1" ; - dynapi:defaultValue "1" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . - - - 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 . - -##################### -## Creation fields ## -##################### - - - a dynapi:Parameter ; - dynapi:name "current_uri_persisted" ; - dynapi:hasType . - - - 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 . - - - a dynapi:Parameter ; - dynapi:name "label" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "first_name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "middle_name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "last_name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "type" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "positions" ; - dynapi:defaultValue "[]" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "internalID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "ORCID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "SCOPUSAuthorID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "ResearcherID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "item" ; - dynapi:hasType . - -######################### -## Read request fields ## -######################### - - - a dynapi:Parameter ; - dynapi:name "resource_id" ; - dynapi:hasType ; - rdfs:label "resource uri"@en-US . - - - a dynapi:parameter ; - dynapi:name "total" ; - dynapi:hasType ; - rdfs:label "total"@en-US . - - - a dynapi:parameter ; - dynapi:name "limit" ; - dynapi:defaultValue "20" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "limit"@en-US . - - - a dynapi:parameter ; - dynapi:name "offset" ; - dynapi:defaultValue "0" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "offset"@en-US . - - - a dynapi:parameter ; - dynapi:name "sortBy" ; - dynapi:defaultValue "label" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "sortBy"@en-US . - - - a dynapi:parameter ; - dynapi:name "order" ; - dynapi:defaultValue "ASC" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "order"@en-US . - -########################### -## Delete request fields ## -########################### - - - a dynapi:Model ; - dynapi:name "person_graph" ; - dynapi:hasType . - -############################################### -### POSITION FIELDS -############################################### - -# Internal - - - a dynapi:Parameter ; - dynapi:name "organizationUnitURI_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "organizationUnitURI" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "organizationUnitName_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "organizationUnitName" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "positionName_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "positionName" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "positionType_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "positionType" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "startDate_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "startDate" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "endDate_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "endDate" ; - dynapi:hasType . - -# Provided - - - a dynapi:Parameter ; - dynapi:name "organizationUnitURI" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "organizationUnitName" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "positionName" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "positionType" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "startDate" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "endDate" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - -############################################### -### PARAMETER CHECKS -############################################### - -# Person attributes - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person first name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person middle name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person last name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person type is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person internal ID is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person ORCID is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person SCOPUS author id is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person researcher ID is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person positions are defined"@en-US ; - dynapi:requiresParameter . - -# Person position container keys - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - -############################################### -### ACCESS CONTROL -############################################### - - - a dynapi:GroupAccessWhitelist ; - dynapi:userGroup . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_event.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_event.n3 deleted file mode 100644 index d07e7a94e..000000000 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_event.n3 +++ /dev/null @@ -1,15 +0,0 @@ -@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/endpoint_resource_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 deleted file mode 100644 index 972bf9e2f..000000000 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_person.n3 +++ /dev/null @@ -1,15 +0,0 @@ -@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/enpoint_procedure_CRUD_event.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/enpoint_procedure_CRUD_event.n3 deleted file mode 100644 index 58a30a508..000000000 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/enpoint_procedure_CRUD_event.n3 +++ /dev/null @@ -1,720 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix vitro: . -@prefix dynapi: . -@prefix dynapi_java: . -@prefix xsd: . - -############################################### -### N3 TEMPLATE PARTIAL ENTITY CREATION -############################################### - - - a dynapi:N3Template ; - rdfs:label "create event N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?uri ; - """ . - - - a dynapi:N3Template ; - rdfs:label "create event type N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?type . " . - - - a dynapi:N3Template ; - rdfs:label "create event name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?name . " . - - - a dynapi:N3Template ; - rdfs:label "create event abbreviation N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?abbreviation . " . - - - a dynapi:N3Template ; - rdfs:label "create event startDate N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?startDate . " . - - - a dynapi:N3Template ; - rdfs:label "create event endDate N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?endDate . " . - - - a dynapi:N3Template ; - rdfs:label "create event place N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?place . " . - - - a dynapi:N3Template ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - @prefix dynapi: . - @prefix rdfs: . - - ?venueURI ; - ?venueName . - - ?uri ?venueURI . - """ . - -############################################### -### N3 TEMPLATE PARTIAL ENTITY UPDATE -############################################### - - - a dynapi:N3Template ; - rdfs:label "create event N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?resource_id ; - """ . - - - a dynapi:N3Template ; - rdfs:label "create event type N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?type . " . - - - a dynapi:N3Template ; - rdfs:label "create event name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?name . " . - - - a dynapi:N3Template ; - rdfs:label "create event abbreviation N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?abbreviation . " . - - - a dynapi:N3Template ; - rdfs:label "create event startDate N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?startDate . " . - - - a dynapi:N3Template ; - rdfs:label "create event endDate N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?endDate . " . - - - a dynapi:N3Template ; - rdfs:label "create event place N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?place . " . - - - a dynapi:N3Template ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - @prefix dynapi: . - @prefix rdfs: . - - ?venueURI ; - ?venueName . - - ?resource_id ?venueURI . - """ . - -############################################### -### CREATE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Create an event"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep ; - dynapi:providesParameter . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an event step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for event type check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an event step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for event name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an event step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for event abbreviation check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an event step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for event startDate check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an event step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for event endDate check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an event step 6"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for event place check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an event step 7"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for event venue check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for event venue name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - -############################################### -### READ (all) -############################################### - - - a dynapi:Procedure ; - rdfs:label "Fetching OUs"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "fetch events step"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "read events sparql query"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - 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 - """ . - - - a dynapi:OperationalStep ; - rdfs:label "number of events step "@en-US ; - dynapi:hasOperation . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "number of events sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; - dynapi:sparqlQueryText - """ - SELECT (count(distinct ?uri) as ?count) - WHERE - { - ?uri - } - """ . - -############################################### -### READ (one) -############################################### - - - a dynapi:Procedure ; - rdfs:label "Fetching an event"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "reading of an event"@en-US ; - dynapi:hasOperation . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "read event sparql query"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:providesParameter ; - 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 - """ . - -############################################### -### DELETE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Deleting a OU"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - 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 ; - dynapi:requiresParameter ; - dynapi:hasModel . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ModelWriter ; - dynapi:retractionModel ; - dynapi:targetModel . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:ProcedurePoolAtomicOperation ; - dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . - -########################## -## Unpacking operations ## -########################## - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - -############################################### -### PARAMETERS -############################################### - -#################### -## Event response ## -#################### - - - a dynapi:Parameter ; - rdfs:label "events"@en-US ; - dynapi:name "events" ; - dynapi:description "List of available events and statistics (number)" ; - dynapi:hasType . - - - a dynapi:Parameter ; - rdfs:label "Number of fetched events"@en-US ; - dynapi:name "count" ; - dynapi:hasType . - -##################### -## Creation fields ## -##################### - - - 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 . - - - a dynapi:Parameter ; - dynapi:name "type" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "abbreviation" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "startDate" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "endDate" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "place" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "eventVenue" ; - dynapi:defaultValue "{}" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - 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 . - - - a dynapi:Parameter ; - dynapi:name "venueName" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - -# Event Venue keys - - - a dynapi:Parameter ; - dynapi:name "eventVenueName_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "name" ; - dynapi:hasType . - -######################### -## Read request fields ## -######################### - - - a dynapi:Parameter ; - dynapi:name "resource_id" ; - dynapi:hasType ; - rdfs:label "resource uri"@en-US . - - - a dynapi:parameter ; - dynapi:name "total" ; - dynapi:hasType ; - rdfs:label "total"@en-US . - - - a dynapi:parameter ; - dynapi:name "limit" ; - dynapi:defaultValue "20" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "limit"@en-US . - - - a dynapi:parameter ; - dynapi:name "offset" ; - dynapi:defaultValue "0" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "offset"@en-US . - - - a dynapi:parameter ; - dynapi:name "sortBy" ; - dynapi:defaultValue "label" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "sortBy"@en-US . - - - a dynapi:parameter ; - dynapi:name "order" ; - dynapi:defaultValue "ASC" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "order"@en-US . - -########################### -## Delete request fields ## -########################### - - - a dynapi:Model ; - dynapi:name "event_graph" ; - dynapi:hasType . - -############################################### -### PARAMETER CHECKS -############################################### - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if event type is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if event name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if event abbreviation is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if event startDate is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if event endDate is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if event place is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if event venue is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - -############################################### -### ACCESS CONTROL -############################################### - - - a dynapi:GroupAccessWhitelist ; - dynapi:userGroup . 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 index ed907c25e..8a7c6c90e 100644 --- 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 @@ -9,7 +9,8 @@ @prefix fetching_properties: . @prefix statistics: . @prefix dynapi_model: . -@prefix read_parameter: . +@prefix response_parameters: . +@prefix request_parameters: . ############################################### ### READ (all) @@ -19,8 +20,8 @@ a dynapi:Procedure ; rdfs:label "Fetching OUs"@en-US ; dynapi:accessWhitelist whitelist_access:admin ; - dynapi:providesParameter read_parameter:events ; - dynapi:providesParameter read_parameter:count ; + dynapi:providesParameter response_parameters:events ; + dynapi:providesParameter response_parameters:count ; dynapi:hasFirstStep fetching_properties:step . fetching_properties:step @@ -33,11 +34,11 @@ fetching_properties:sparql_select_query a dynapi:SparqlSelectQuery ; rdfs:label "read events sparql query"@en-US ; dynapi:hasModel dynapi_model:full_union ; - dynapi:providesParameter read_parameter:events ; - dynapi:requiresPlainParameter read_parameter:limit ; - dynapi:requiresPlainParameter read_parameter:offset ; - dynapi:requiresPlainParameter read_parameter:sortBy ; - dynapi:requiresPlainParameter read_parameter:order ; + 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) @@ -78,7 +79,7 @@ statistics:sparql_query a dynapi:SparqlSelectQuery ; rdfs:label "number of events sparql query 1"@en-US ; dynapi:hasModel dynapi_model:full_union ; - dynapi:providesParameter read_parameter:count ; + dynapi:providesParameter response_parameters:count ; dynapi:sparqlQueryText """ SELECT (count(distinct ?uri) as ?count) 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 index 7ed5f6604..14d8c4956 100644 --- 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 @@ -5,6 +5,11 @@ @prefix dynapi: . @prefix dynapi_java: . @prefix xsd: . +@prefix response_parameters: . +@prefix read_parameters: . +@prefix dynapi_model: . +@prefix whitelist_access: . +@prefix fetching_properties: . ############################################### ### READ (one) @@ -13,21 +18,21 @@ a dynapi:Procedure ; rdfs:label "Fetching an event"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:hasFirstStep . + 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 . + dynapi:hasOperation fetching_properties:sparql_query . - +fetching_properties:sparql_query a dynapi:SparqlSelectQuery ; rdfs:label "read event sparql query"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:providesParameter ; + 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) 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 index 5052927d6..0dae5d65c 100644 --- 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 @@ -6,6 +6,8 @@ @prefix dynapi_java: . @prefix xsd: . @prefix dynapi_type: . +@prefix response_parameters: . +@prefix request_parameters: . ############################################### ### PARAMETERS @@ -15,14 +17,14 @@ ## 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" ; @@ -32,14 +34,14 @@ ## 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 "" ; @@ -47,7 +49,7 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType dynapi_type:uri . - +request_parameters:name a dynapi:Parameter ; dynapi:name "name" ; dynapi:defaultValue "" ; @@ -55,7 +57,7 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType dynapi_type:string-literal . - +request_parameters:abbreviation a dynapi:Parameter ; dynapi:name "abbreviation" ; dynapi:defaultValue "" ; @@ -63,7 +65,7 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType dynapi_type:string-literal . - +request_parameters:startDate a dynapi:Parameter ; dynapi:name "startDate" ; dynapi:defaultValue "" ; @@ -71,7 +73,7 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType dynapi_type:string-literal . - +request_parameters:endDate a dynapi:Parameter ; dynapi:name "endDate" ; dynapi:defaultValue "" ; @@ -79,7 +81,7 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType dynapi_type:string-literal . - +request_parameters:place a dynapi:Parameter ; dynapi:name "place" ; dynapi:defaultValue "" ; @@ -87,7 +89,7 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType dynapi_type:string-literal . - +request_parameters:eventVenue a dynapi:Parameter ; dynapi:name "eventVenue" ; dynapi:defaultValue "{}" ; @@ -95,14 +97,14 @@ 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 "" ; @@ -112,7 +114,7 @@ # Event Venue keys - +request_parameters:eventVenueName_key a dynapi:Parameter ; dynapi:name "eventVenueName_key" ; dynapi:isInternal "true"^^xsd:boolean ; @@ -123,19 +125,19 @@ ## 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" ; @@ -144,7 +146,7 @@ dynapi:hasType dynapi_type:integer ; rdfs:label "limit"@en-US . - +request_parameters:offset a dynapi:parameter ; dynapi:name "offset" ; dynapi:defaultValue "0" ; @@ -153,7 +155,7 @@ dynapi:hasType dynapi_type:integer ; rdfs:label "offset"@en-US . - +request_parameters:sortBy a dynapi:parameter ; dynapi:name "sortBy" ; dynapi:defaultValue "label" ; @@ -162,7 +164,7 @@ dynapi:hasType dynapi_type:string ; rdfs:label "sortBy"@en-US . - +request_parameters:order a dynapi:parameter ; dynapi:name "order" ; dynapi:defaultValue "ASC" ; @@ -175,7 +177,7 @@ ## 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 index c32a25577..361957c35 100644 --- 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 @@ -5,65 +5,69 @@ @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 ; - dynapi:requiresParameter ; - dynapi:providesParameter . + 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 . + dynapi:requiresParameter creation_parameters:type . - +condition:name_check a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if event name is defined"@en-US ; - dynapi:requiresParameter . + dynapi:requiresParameter creation_parameters:name . - +condition:abbreviation_check a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if event abbreviation is defined"@en-US ; - dynapi:requiresParameter . + dynapi:requiresParameter creation_parameters:abbreviation . - +condition:startDate_check a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if event startDate is defined"@en-US ; - dynapi:requiresParameter . + dynapi:requiresParameter creation_parameters:startDate . - +condition:endDate_check a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if event endDate is defined"@en-US ; - dynapi:requiresParameter . + dynapi:requiresParameter creation_parameters:endDate . - +condition:place_check a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if event place is defined"@en-US ; - dynapi:requiresParameter . + dynapi:requiresParameter creation_parameters:place . - +condition:eventVenue_check a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if event venue is defined"@en-US ; - dynapi:requiresParameter . + dynapi:requiresParameter creation_parameters:eventVenue . - +condition:contains_event_name_key a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . + 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/endpoint_procedure_CRUD_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_procedure_CRUD_organisation_unit.n3 deleted file mode 100644 index 62afc0370..000000000 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_procedure_CRUD_organisation_unit.n3 +++ /dev/null @@ -1,722 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix vitro: . -@prefix dynapi: . -@prefix dynapi_java: . -@prefix xsd: . - -############################################### -### N3 TEMPLATE PARTIAL ENTITY CREATION -############################################### - - - a dynapi:N3Template ; - rdfs:label "create OU N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?uri ; - """ . - - - a dynapi:N3Template ; - rdfs:label "create OU type N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?type . " . - - - a dynapi:N3Template ; - rdfs:label "create OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?name . " . - - - a dynapi:N3Template ; - rdfs:label "create OU description N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?description . " . - - - a dynapi:N3Template ; - rdfs:label "create super OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?superURI . " . - - - a dynapi:N3Template ; - rdfs:label "create super OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?superName . " . - -############################################### -### N3 TEMPLATE PARTIAL ENTITY UPDATE -############################################### - - - a dynapi:N3Template ; - rdfs:label "update OU N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?resource_id ; - """ . - - - a dynapi:N3Template ; - rdfs:label "update OU type N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?type . " . - - - a dynapi:N3Template ; - rdfs:label "update OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?name . " . - - - a dynapi:N3Template ; - rdfs:label "update OU description N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?description . " . - - - a dynapi:N3Template ; - rdfs:label "update super OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?superURI . " . - - - a dynapi:N3Template ; - rdfs:label "update super OU name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?superName . " . - -############################################### -### CREATE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Create an OU"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep ; - dynapi:providesParameter . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU type check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU description check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU URI check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 6"@en-US ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . - -############################################### -### READ (all) -############################################### - - - a dynapi:Procedure ; - rdfs:label "Fetching OUs"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "fetch OUs step"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "read OUs sparql query"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - 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 - """ . - - - a dynapi:OperationalStep ; - rdfs:label "number of OUs step "@en-US ; - dynapi:hasOperation . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "number of OUs sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; - dynapi:sparqlQueryText - """ - SELECT (count(distinct ?uri) as ?count) - WHERE - { - ?uri - } - """ . - -############################################### -### READ (one) -############################################### - - - a dynapi:Procedure ; - rdfs:label "Fetching an OU"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "reading of an OU"@en-US ; - dynapi:hasOperation . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "read OU sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:providesParameter ; - 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 - """ . - -############################################### -### DELETE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Deleting an OU"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - 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 ; - dynapi:requiresParameter ; - dynapi:hasModel . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ModelWriter ; - dynapi:retractionModel ; - dynapi:targetModel . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:ProcedurePoolAtomicOperation ; - dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . - -############################################### -### UPDATE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Updating a OU"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ModelWriter ; - dynapi:retractionModel ; - dynapi:targetModel . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ProcedurePoolAtomicOperation ; - dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU type check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for OU description check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU URI check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for super OU name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - rdfs:label "creation of an OU step 6"@en-US ; - dynapi:hasOperation . - -############################################### -### PARAMETERS -############################################### - -################################ -## Organization unit response ## -################################ - - - a dynapi:Parameter ; - rdfs:label "organizationUnits"@en-US ; - dynapi:name "organizationUnits" ; - dynapi:description "List of available OUs and statistics (number)" ; - dynapi:hasType . - - - a dynapi:Parameter ; - rdfs:label "Number of fetched OUs"@en-US ; - dynapi:name "count" ; - dynapi:hasType . - -##################### -## Creation fields ## -##################### - - - 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 . - - - a dynapi:Parameter ; - dynapi:name "type" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "description" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "superURI" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "superName" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "superOrganizationUnit" ; - dynapi:defaultValue "{}" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - -# Super Organisation Unit keys - - - a dynapi:Parameter ; - dynapi:name "superOrganizationUnitURI_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "uri" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "superOrganizationUnitName_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "name" ; - dynapi:hasType . - -######################### -## Read request fields ## -######################### - - - a dynapi:Parameter ; - dynapi:name "resource_id" ; - dynapi:hasType ; - rdfs:label "resource uri"@en-US . - - - a dynapi:parameter ; - dynapi:name "total" ; - dynapi:hasType ; - rdfs:label "total"@en-US . - - - a dynapi:parameter ; - dynapi:name "limit" ; - dynapi:defaultValue "20" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "limit"@en-US . - - - a dynapi:parameter ; - dynapi:name "offset" ; - dynapi:defaultValue "0" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "offset"@en-US . - - - a dynapi:parameter ; - dynapi:name "sortBy" ; - dynapi:defaultValue "label" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "sortBy"@en-US . - - - a dynapi:parameter ; - dynapi:name "order" ; - dynapi:defaultValue "ASC" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "order"@en-US . - -########################### -## Delete request fields ## -########################### - - - a dynapi:Model ; - dynapi:name "organization_unit_graph" ; - dynapi:hasType . - -############################################### -### PARAMETER CHECKS -############################################### - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if OU type is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if OU name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if OU description is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if super OU is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if super OU name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if super OU is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - -############################################### -### ACCESS CONTROL -############################################### - - - a dynapi:GroupAccessWhitelist ; - dynapi:userGroup . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_resource_CRUD_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_resource_CRUD_organisation_unit.n3 deleted file mode 100644 index 8d1189ed7..000000000 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/endpoint_resource_CRUD_organisation_unit.n3 +++ /dev/null @@ -1,15 +0,0 @@ -@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/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..e787bec9a --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_delete_organisation_unit.n3 @@ -0,0 +1,75 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@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 . + +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 . + +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..29c2c26bb --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_read_all_organisation_units.n3 @@ -0,0 +1,78 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@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: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: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..a0acb4486 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/procedure/endpoint_procedure_read_organisation_unit.n3 @@ -0,0 +1,52 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@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: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/endpoint_resource_CRUD_organisation_unit.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_API.n3 similarity index 100% rename from home/src/main/resources/rdf/dynapiAbox/everytime/endpoint_resource_CRUD_organisation_unit.n3 rename to home/src/main/resources/rdf/dynapiAbox/everytime/organization_unit/resource/endpoint_resource_organisation_unit_API.n3 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 . From 5f78f097dfcdbe2f76fb3b130043ff1473a209fb Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 18 Sep 2023 18:57:25 +0200 Subject: [PATCH 34/38] Fixed person position creation bug. Started working on refactoring person procedures. --- .../endpoint_procedure_CRUD_person.n3 | 305 ++++++------------ .../endpoint_resource_person_API.n3} | 0 .../endpoint_resource_person_utils.n3 | 138 ++++++++ 3 files changed, 228 insertions(+), 215 deletions(-) rename home/src/main/resources/rdf/dynapiAbox/everytime/person/{ => procedure}/endpoint_procedure_CRUD_person.n3 (85%) rename home/src/main/resources/rdf/dynapiAbox/everytime/person/{endpoint_resource_CRUD_person.n3 => resource/endpoint_resource_person_API.n3} (100%) create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_utils.n3 diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_CRUD_person.n3 similarity index 85% rename from home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_procedure_CRUD_person.n3 rename to home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_CRUD_person.n3 index b27d23277..1159be083 100644 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_procedure_CRUD_person.n3 +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_CRUD_person.n3 @@ -292,14 +292,14 @@ dynapi:nextIfSatisfied ; dynapi:hasCondition . - + a dynapi:ParameterSubstitution ; dynapi:substitutionSource ; dynapi:substitutionTarget . a dynapi:OperationalStep ; - dynapi:hasParameterSubstitution ; + dynapi:hasParameterSubstitution ; dynapi:hasOperation ; rdfs:label "Create provided person positions"@en-US . @@ -314,34 +314,34 @@ dynapi:outputDescriptor ; dynapi:executableDescriptor ; - dynapi:internalParameter ; + dynapi:internalParameter ; - dynapi:internalParameter ; - dynapi:providesParameter . + dynapi:internalParameter ; + dynapi:providesParameter . a dynapi:ProcedureDescriptor ; - dynapi:providesParameter ; - dynapi:requiresParameter ; + dynapi:providesParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:call . a dynapi:ProcedureDescriptor ; - dynapi:providesParameter ; - dynapi:requiresParameter ; + dynapi:providesParameter ; + dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:call . a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:providesParameter ; + dynapi:requiresParameter ; + dynapi:providesParameter ; dynapi:call . a dynapi:Procedure ; - dynapi:providesParameter ; + dynapi:providesParameter ; dynapi:hasFirstStep . @@ -350,14 +350,15 @@ a dynapi:SumOperation ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:providesParameter . a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:call . ## Loop end @@ -368,7 +369,7 @@ a dynapi:Procedure ; dynapi:hasFirstStep ; - dynapi:providesParameter . + dynapi:providesParameter . a dynapi:OperationalStep ; @@ -376,16 +377,16 @@ a dynapi:ContainerQuery ; - dynapi:providesParameter ; + dynapi:providesParameter ; dynapi:targetContainer ; - dynapi:requiresParameter . + dynapi:requiresParameter . ############################################################ #Condition procedure a dynapi:Procedure ; - dynapi:providesParameter ; + dynapi:providesParameter ; dynapi:hasFirstStep . @@ -399,14 +400,14 @@ a dynapi:SumOperation ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:providesParameter . a dynapi:ConditionContainerContains ; dynapi:targetContainer ; - dynapi:requiresParameter . + dynapi:requiresParameter . ############################################################ #Add person position construct query @@ -419,103 +420,67 @@ a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:hasOperation . a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:hasOperation . a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:hasOperation . a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:hasOperation . a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:hasOperation . a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:hasOperation . a dynapi:OperationalStep ; @@ -531,7 +496,7 @@ dynapi:requiresParameter ; dynapi:requiresParameter ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions """ @prefix dynapi: . @@ -555,7 +520,7 @@ a dynapi:N3Template ; dynapi:hasModel ; dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:N3TextAdditions """ @prefix dynapi: . @@ -576,67 +541,67 @@ a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . + dynapi:hasOperation . a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . + dynapi:hasOperation . a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . + dynapi:hasOperation . a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . + dynapi:hasOperation . a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . + dynapi:hasOperation . a dynapi:ConditionalStep ; dynapi:nextIfSatisfied ; dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + dynapi:hasCondition . a dynapi:OperationalStep ; dynapi:hasNextStep ; - dynapi:hasOperation . + dynapi:hasOperation . a dynapi:OperationalStep ; @@ -670,10 +635,10 @@ rdfs:label "read persons sparql query"@en-US ; dynapi:hasModel ; dynapi:providesParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; + dynapi:requiresPlainParameter ; dynapi:sparqlQueryText """ SELECT ?uri @@ -881,7 +846,7 @@ } } """ ; - dynapi:providesParameter ; + dynapi:providesParameter ; dynapi:requiresParameter ; dynapi:hasModel . @@ -892,7 +857,7 @@ a dynapi:ModelWriter ; - dynapi:retractionModel ; + dynapi:retractionModel ; dynapi:targetModel . @@ -926,7 +891,7 @@ a dynapi:ModelWriter ; - dynapi:retractionModel ; + dynapi:retractionModel ; dynapi:targetModel . @@ -1054,14 +1019,14 @@ dynapi:nextIfSatisfied ; dynapi:hasCondition . - + a dynapi:ParameterSubstitution ; dynapi:substitutionSource ; dynapi:substitutionTarget . a dynapi:OperationalStep ; - dynapi:hasParameterSubstitution ; + dynapi:hasParameterSubstitution ; dynapi:hasOperation ; rdfs:label "Create provided person positions"@en-US . @@ -1073,15 +1038,16 @@ dynapi:outputDescriptor ; dynapi:executableDescriptor ; - dynapi:internalParameter ; + dynapi:internalParameter ; - dynapi:internalParameter ; - dynapi:providesParameter . + dynapi:internalParameter ; + dynapi:providesParameter . a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; dynapi:call . ############################################### @@ -1109,46 +1075,51 @@ ## Iteration params ## ###################### - + a dynapi:Parameter ; dynapi:name "iteration_param" ; dynapi:defaultValue "0" ; dynapi:hasType . - + a dynapi:Parameter ; dynapi:name "int_1" ; dynapi:defaultValue "1" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:hasType . - + a dynapi:Parameter ; dynapi:name "condition_result" ; dynapi:defaultValue "0" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:hasType . - + a dynapi:Parameter ; dynapi:name "condition_result" ; dynapi:defaultValue "1" ; dynapi:hasType . - + a dynapi:Parameter ; dynapi:name "int_1" ; dynapi:defaultValue "1" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:hasType . - + 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 . + + a dynapi:Parameter ; + dynapi:name "item" ; + dynapi:hasType . + ##################### ## Creation fields ## ##################### @@ -1242,11 +1213,6 @@ dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . - - a dynapi:Parameter ; - dynapi:name "item" ; - dynapi:hasType . - ######################### ## Read request fields ## ######################### @@ -1257,13 +1223,13 @@ dynapi:hasType ; rdfs:label "resource uri"@en-US . - + a dynapi:parameter ; dynapi:name "total" ; dynapi:hasType ; rdfs:label "total"@en-US . - + a dynapi:parameter ; dynapi:name "limit" ; dynapi:defaultValue "20" ; @@ -1272,7 +1238,7 @@ dynapi:hasType ; rdfs:label "limit"@en-US . - + a dynapi:parameter ; dynapi:name "offset" ; dynapi:defaultValue "0" ; @@ -1281,7 +1247,7 @@ dynapi:hasType ; rdfs:label "offset"@en-US . - + a dynapi:parameter ; dynapi:name "sortBy" ; dynapi:defaultValue "label" ; @@ -1290,7 +1256,7 @@ dynapi:hasType ; rdfs:label "sortBy"@en-US . - + a dynapi:parameter ; dynapi:name "order" ; dynapi:defaultValue "ASC" ; @@ -1303,7 +1269,7 @@ ## Delete request fields ## ########################### - + a dynapi:Model ; dynapi:name "person_graph" ; dynapi:hasType . @@ -1314,42 +1280,42 @@ # Internal - + a dynapi:Parameter ; dynapi:name "organizationUnitURI_key" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:defaultValue "organizationUnitURI" ; dynapi:hasType . - + a dynapi:Parameter ; dynapi:name "organizationUnitName_key" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:defaultValue "organizationUnitName" ; dynapi:hasType . - + a dynapi:Parameter ; dynapi:name "positionName_key" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:defaultValue "positionName" ; dynapi:hasType . - + a dynapi:Parameter ; dynapi:name "positionType_key" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:defaultValue "positionType" ; dynapi:hasType . - + a dynapi:Parameter ; dynapi:name "startDate_key" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:defaultValue "startDate" ; dynapi:hasType . - + a dynapi:Parameter ; dynapi:name "endDate_key" ; dynapi:isInternal "true"^^xsd:boolean ; @@ -1405,94 +1371,3 @@ dynapi:isInternal "true"^^xsd:boolean ; dynapi:isOptionalParam "true"^^xsd:boolean ; dynapi:hasType . - -############################################### -### PARAMETER CHECKS -############################################### - -# Person attributes - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person first name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person middle name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person last name is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person type is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person internal ID is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person ORCID is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person SCOPUS author id is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person researcher ID is defined"@en-US ; - dynapi:requiresParameter . - - - a dynapi:ConditionIsNotEmpty ; - rdfs:label "condition if person positions are defined"@en-US ; - dynapi:requiresParameter . - -# Person position container keys - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - -############################################### -### ACCESS CONTROL -############################################### - - - a dynapi:GroupAccessWhitelist ; - dynapi:userGroup . diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_resource_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_API.n3 similarity index 100% rename from home/src/main/resources/rdf/dynapiAbox/everytime/person/endpoint_resource_CRUD_person.n3 rename to home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_API.n3 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..7ceb3bdb2 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_utils.n3 @@ -0,0 +1,138 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +########################## +## Unpacking operations ## +########################## + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ContainerQuery ; + dynapi:targetContainer ; + dynapi:requiresParameter ; + dynapi:providesParameter . + +############################################### +### PARAMETER CHECKS +############################################### + +# Person attributes + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person first name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person middle name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person last name is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person type is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person internal ID is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person ORCID is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person SCOPUS author id is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person researcher ID is defined"@en-US ; + dynapi:requiresParameter . + + + a dynapi:ConditionIsNotEmpty ; + rdfs:label "condition if person positions are defined"@en-US ; + dynapi:requiresParameter . + +# Person position container keys + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . + +############################################### +### ACCESS CONTROL +############################################### + + + a dynapi:GroupAccessWhitelist ; + dynapi:userGroup . \ No newline at end of file From a908411aada8e9c5abca7773e24d195b5a977db3 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 21 Sep 2023 22:13:10 +0200 Subject: [PATCH 35/38] Refactoring person .n3 files. --- .../endpoint_procedure_CRUD_person.n3 | 1373 ----------------- .../endpoint_procedure_create_person.n3 | 275 ++++ .../endpoint_procedure_delete_person.n3 | 98 ++ .../endpoint_procedure_increment_iterator.n3 | 24 + .../endpoint_procedure_read_all_persons.n3 | 111 ++ .../endpoint_procedure_read_person.n3 | 83 + .../endpoint_procedure_update_person.n3 | 268 ++++ .../endpoint_resource_person_parameters.n3 | 329 ++++ .../endpoint_resource_person_utils.n3 | 2 +- .../procedure_add_person_position.n3 | 128 ++ .../procedure_contains_position_item.n3 | 35 + .../procedure_get_position_from_container.n3 | 25 + .../procedure_update_person_position.n3 | 89 ++ 13 files changed, 1466 insertions(+), 1374 deletions(-) delete mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_CRUD_person.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_create_person.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_delete_person.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_increment_iterator.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_read_all_persons.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_read_person.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_update_person.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_parameters.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_add_person_position.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_contains_position_item.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_get_position_from_container.n3 create mode 100644 home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_update_person_position.n3 diff --git a/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_CRUD_person.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_CRUD_person.n3 deleted file mode 100644 index 1159be083..000000000 --- a/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_CRUD_person.n3 +++ /dev/null @@ -1,1373 +0,0 @@ -@prefix rdf: . -@prefix rdfs: . -@prefix owl: . -@prefix vitro: . -@prefix dynapi: . -@prefix dynapi_java: . -@prefix xsd: . - -############################################### -### N3 TEMPLATE PARTIAL ENTITY CREATION -############################################### - - - a dynapi:N3Template ; - rdfs:label "create person N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?uri ; - ?label . - """ . - - - a dynapi:N3Template ; - rdfs:label "create person first name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?first_name . " . - - - a dynapi:N3Template ; - rdfs:label "create person middle name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?middle_name . " . - - - a dynapi:N3Template ; - rdfs:label "create person last name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?last_name . " . - - - a dynapi:N3Template ; - rdfs:label "create person type N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?type . " . - - - a dynapi:N3Template ; - rdfs:label "create person internal id N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?internalID . " . - - - a dynapi:N3Template ; - rdfs:label "create person ORCID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?ORCID . " . - - - a dynapi:N3Template ; - rdfs:label "create person SCOPUS author ID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?SCOPUSAuthorID . " . - - - a dynapi:N3Template ; - rdfs:label "create person researcher ID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?uri ?ResearcherID . " . - -############################################### -### N3 TEMPLATE PARTIAL ENTITY UPDATE -############################################### - - - a dynapi:N3Template ; - rdfs:label "update person N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - ?resource_id ; - ?label . - """ . - - - a dynapi:N3Template ; - rdfs:label "update person first name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?first_name . " . - - - a dynapi:N3Template ; - rdfs:label "update person middle name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?middle_name . " . - - - a dynapi:N3Template ; - rdfs:label "update person last name N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?last_name . " . - - - a dynapi:N3Template ; - rdfs:label "update person type N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?type . " . - - - a dynapi:N3Template ; - rdfs:label "update person internal id N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?internalID . " . - - - a dynapi:N3Template ; - rdfs:label "update person ORCID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?ORCID . " . - - - a dynapi:N3Template ; - rdfs:label "update person SCOPUS author ID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?SCOPUSAuthorID . " . - - - a dynapi:N3Template ; - rdfs:label "update person researcher ID N3 Template"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions "?resource_id ?ResearcherID . " . - -############################################### -### CREATE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Create a person"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep ; - dynapi:providesParameter . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person middle name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person last name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person type check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person internal id check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 6"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person ORCID check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 7"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 8"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person researcher ID check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 9"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person positions check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:ParameterSubstitution ; - dynapi:substitutionSource ; - dynapi:substitutionTarget . - - - a dynapi:OperationalStep ; - dynapi:hasParameterSubstitution ; - dynapi:hasOperation ; - rdfs:label "Create provided person positions"@en-US . - -## Loop start - - - a dynapi:LoopOperation ; - #get positions from array - dynapi:inputDescriptor ; - dynapi:conditionDescriptor ; - - dynapi:outputDescriptor ; - dynapi:executableDescriptor ; - - dynapi:internalParameter ; - - dynapi:internalParameter ; - dynapi:providesParameter . - - - a dynapi:ProcedureDescriptor ; - dynapi:providesParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . - - - a dynapi:ProcedureDescriptor ; - dynapi:providesParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . - - - a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:providesParameter ; - dynapi:call . - - - a dynapi:Procedure ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:SumOperation ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . - -## Loop end - -############################################################ -#Get position from a container - - - a dynapi:Procedure ; - dynapi:hasFirstStep ; - dynapi:providesParameter . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:ContainerQuery ; - dynapi:providesParameter ; - dynapi:targetContainer ; - dynapi:requiresParameter . - -############################################################ -#Condition procedure - - - a dynapi:Procedure ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:SumOperation ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:providesParameter . - - - a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . - -############################################################ -#Add person position construct query - - - a dynapi:Procedure ; - dynapi:hasFirstStep . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:N3Template ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - @prefix dynapi: . - @prefix rdfs: . - - ?current_step_uri ; - ?positionType ; - ?positionName ; - ?organizationUnitName ; - ?organizationUnitURI ; - ?startDate ; - ?endDate . - - """ . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:N3Template ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:N3TextAdditions - """ - @prefix dynapi: . - @prefix rdfs: . - - ?current_uri_persisted ?current_step_uri . - - """ . - -############################################################ -#Update person position construct query - - - a dynapi:Procedure ; - dynapi:hasFirstStep . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - -############################################### -### READ (all) -############################################### - - - a dynapi:Procedure ; - rdfs:label "Fetching persons"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "fetch persons step"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "read persons sparql query"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - dynapi:requiresPlainParameter ; - 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(?positionName), STR(?positionName), ''), - '", "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 - - """ . - - - a dynapi:OperationalStep ; - rdfs:label "number of persons step "@en-US ; - dynapi:hasOperation . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "number of persons sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:providesParameter ; - dynapi:sparqlQueryText - """ - SELECT (count(distinct ?uri) as ?count) - WHERE - { - ?uri - } - """ . - -############################################### -### READ (one) -############################################### - - - a dynapi:Procedure ; - rdfs:label "Fetching a person"@en-US ; - dynapi:accessWhitelist ; - dynapi:providesParameter ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - rdfs:label "reading of a person"@en-US ; - dynapi:hasOperation . - - - a dynapi:SparqlSelectQuery ; - rdfs:label "read person sparql query 1"@en-US ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:providesParameter ; - 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(?positionName), STR(?positionName), ''), - '", "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 - """ . - -############################################### -### DELETE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Deleting a person"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - 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 ; - dynapi:requiresParameter ; - dynapi:hasModel . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ModelWriter ; - dynapi:retractionModel ; - dynapi:targetModel . - - - a dynapi:OperationalStep ; - dynapi:hasOperation . - - - a dynapi:ProcedurePoolAtomicOperation ; - dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . - -############################################### -### UPDATE -############################################### - - - a dynapi:Procedure ; - rdfs:label "Updating a person"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ModelWriter ; - dynapi:retractionModel ; - dynapi:targetModel . - - - a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . - - - a dynapi:ProcedurePoolAtomicOperation ; - dynapi:poolOperationType "unload" ; - dynapi:requiresParameter . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 2"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person middle name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 3"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person last name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 4"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person type check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 5"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person internal id check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 6"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person ORCID check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 7"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 8"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:OperationalStep ; - rdfs:label "creation of a person step 9"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . - - - a dynapi:ConditionalStep ; - rdfs:label "conditional step for person positions check"@en-US ; - dynapi:nextIfSatisfied ; - dynapi:hasCondition . - - - a dynapi:ParameterSubstitution ; - dynapi:substitutionSource ; - dynapi:substitutionTarget . - - - a dynapi:OperationalStep ; - dynapi:hasParameterSubstitution ; - dynapi:hasOperation ; - rdfs:label "Create provided person positions"@en-US . - - - a dynapi:LoopOperation ; - dynapi:inputDescriptor ; - dynapi:conditionDescriptor ; - - dynapi:outputDescriptor ; - dynapi:executableDescriptor ; - - dynapi:internalParameter ; - - dynapi:internalParameter ; - dynapi:providesParameter . - - - a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:call . - -############################################### -### PARAMETERS -############################################### - -##################### -## Person response ## -##################### - - - a dynapi:Parameter ; - rdfs:label "persons"@en-US ; - dynapi:name "persons" ; - dynapi:description "List of available persons and statistics (number)" ; - dynapi:hasType . - - - a dynapi:Parameter ; - rdfs:label "Number of fetched persons"@en-US ; - dynapi:name "count" ; - dynapi:hasType . - -###################### -## Iteration params ## -###################### - - - a dynapi:Parameter ; - dynapi:name "iteration_param" ; - dynapi:defaultValue "0" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "int_1" ; - dynapi:defaultValue "1" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "condition_result" ; - dynapi:defaultValue "0" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "condition_result" ; - dynapi:defaultValue "1" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "int_1" ; - dynapi:defaultValue "1" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:hasType . - - - 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 . - - - a dynapi:Parameter ; - dynapi:name "item" ; - dynapi:hasType . - -##################### -## Creation fields ## -##################### - - - a dynapi:Parameter ; - dynapi:name "current_uri_persisted" ; - dynapi:hasType . - - - 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 . - - - a dynapi:Parameter ; - dynapi:name "label" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "first_name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "middle_name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "last_name" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "type" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "positions" ; - dynapi:defaultValue "[]" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "internalID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "ORCID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "SCOPUSAuthorID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "ResearcherID" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - -######################### -## Read request fields ## -######################### - - - a dynapi:Parameter ; - dynapi:name "resource_id" ; - dynapi:hasType ; - rdfs:label "resource uri"@en-US . - - - a dynapi:parameter ; - dynapi:name "total" ; - dynapi:hasType ; - rdfs:label "total"@en-US . - - - a dynapi:parameter ; - dynapi:name "limit" ; - dynapi:defaultValue "20" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "limit"@en-US . - - - a dynapi:parameter ; - dynapi:name "offset" ; - dynapi:defaultValue "0" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "offset"@en-US . - - - a dynapi:parameter ; - dynapi:name "sortBy" ; - dynapi:defaultValue "label" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "sortBy"@en-US . - - - a dynapi:parameter ; - dynapi:name "order" ; - dynapi:defaultValue "ASC" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType ; - rdfs:label "order"@en-US . - -########################### -## Delete request fields ## -########################### - - - a dynapi:Model ; - dynapi:name "person_graph" ; - dynapi:hasType . - -############################################### -### POSITION FIELDS -############################################### - -# Internal - - - a dynapi:Parameter ; - dynapi:name "organizationUnitURI_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "organizationUnitURI" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "organizationUnitName_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "organizationUnitName" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "positionName_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "positionName" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "positionType_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "positionType" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "startDate_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "startDate" ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "endDate_key" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:defaultValue "endDate" ; - dynapi:hasType . - -# Provided - - - a dynapi:Parameter ; - dynapi:name "organizationUnitURI" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "organizationUnitName" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "positionName" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "positionType" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "startDate" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . - - - a dynapi:Parameter ; - dynapi:name "endDate" ; - dynapi:defaultValue "" ; - dynapi:isInternal "true"^^xsd:boolean ; - dynapi:isOptionalParam "true"^^xsd:boolean ; - dynapi:hasType . 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..feb2a2c73 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_create_person.n3 @@ -0,0 +1,275 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@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 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 researcher ID check"@en-US ; + dynapi:nextIfSatisfied creation_properties:step9 ; + 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: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: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: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: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: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: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: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: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: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..91872cc53 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_delete_person.n3 @@ -0,0 +1,98 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@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 . + +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 . + +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..682eb1a38 --- /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 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: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(?positionName), STR(?positionName), ''), + '", "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: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..2de4f6532 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_read_person.n3 @@ -0,0 +1,83 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@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: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(?positionName), STR(?positionName), ''), + '", "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..c76929740 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/procedure/endpoint_procedure_update_person.n3 @@ -0,0 +1,268 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################### +### UPDATE +############################################### + + + a dynapi:Procedure ; + rdfs:label "Updating a person"@en-US ; + dynapi:accessWhitelist ; + dynapi:hasFirstStep . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ModelWriter ; + dynapi:retractionModel ; + dynapi:targetModel . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ProcedurePoolAtomicOperation ; + dynapi:poolOperationType "unload" ; + dynapi:requiresParameter . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 1"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 2"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person middle name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 3"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person last name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 4"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person type check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 5"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person internal id check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 6"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person ORCID check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 7"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 8"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person first name check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + rdfs:label "creation of a person step 9"@en-US ; + dynapi:hasOperation ; + dynapi:hasNextStep . + + + a dynapi:ConditionalStep ; + rdfs:label "conditional step for person positions check"@en-US ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:ParameterSubstitution ; + dynapi:substitutionSource ; + dynapi:substitutionTarget . + + + a dynapi:OperationalStep ; + dynapi:hasParameterSubstitution ; + dynapi:hasOperation ; + rdfs:label "Create provided person positions"@en-US . + + + a dynapi:LoopOperation ; + dynapi:inputDescriptor ; + dynapi:conditionDescriptor ; + + dynapi:outputDescriptor ; + dynapi:executableDescriptor ; + + dynapi:internalParameter ; + + dynapi:internalParameter ; + dynapi:providesParameter . + + + a dynapi:ProcedureDescriptor ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:call . + +############################################### +### N3 TEMPLATE PARTIAL ENTITY UPDATE +############################################### + + + a dynapi:N3Template ; + rdfs:label "update person N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + ?resource_id ; + ?label . + """ . + + + a dynapi:N3Template ; + rdfs:label "update person first name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?first_name . " . + + + a dynapi:N3Template ; + rdfs:label "update person middle name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?middle_name . " . + + + a dynapi:N3Template ; + rdfs:label "update person last name N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?last_name . " . + + + a dynapi:N3Template ; + rdfs:label "update person type N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?type . " . + + + a dynapi:N3Template ; + rdfs:label "update person internal id N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?internalID . " . + + + a dynapi:N3Template ; + rdfs:label "update person ORCID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?ORCID . " . + + + a dynapi:N3Template ; + rdfs:label "update person SCOPUS author ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?SCOPUSAuthorID . " . + + + a dynapi:N3Template ; + rdfs:label "update person researcher ID N3 Template"@en-US ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions "?resource_id ?ResearcherID . " . 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..93708e727 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_parameters.n3 @@ -0,0 +1,329 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################### +### PARAMETERS +############################################### + +##################### +## Person response ## +##################### + + + a dynapi:Parameter ; + rdfs:label "persons"@en-US ; + dynapi:name "persons" ; + dynapi:description "List of available persons and statistics (number)" ; + dynapi:hasType . + + + a dynapi:Parameter ; + rdfs:label "Number of fetched persons"@en-US ; + dynapi:name "count" ; + dynapi:hasType . + +###################### +## Iteration params ## +###################### + + + a dynapi:Parameter ; + dynapi:name "iteration_param" ; + dynapi:defaultValue "0" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "int_1" ; + dynapi:defaultValue "1" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "condition_result" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "condition_result" ; + dynapi:defaultValue "1" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "int_1" ; + dynapi:defaultValue "1" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:hasType . + + + 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 . + + + a dynapi:Parameter ; + dynapi:name "item" ; + dynapi:hasType . + +##################### +## Creation fields ## +##################### + + + a dynapi:Parameter ; + dynapi:name "current_uri_persisted" ; + dynapi:hasType . + + + 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 . + + + a dynapi:Parameter ; + dynapi:name "label" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "first_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "middle_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "last_name" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "type" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positions" ; + dynapi:defaultValue "[]" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "internalID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "ORCID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "SCOPUSAuthorID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "ResearcherID" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + +######################### +## Read request fields ## +######################### + + + a dynapi:Parameter ; + dynapi:name "resource_id" ; + dynapi:hasType ; + rdfs:label "resource uri"@en-US . + + + a dynapi:parameter ; + dynapi:name "total" ; + dynapi:hasType ; + rdfs:label "total"@en-US . + + + a dynapi:parameter ; + dynapi:name "limit" ; + dynapi:defaultValue "20" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "limit"@en-US . + + + a dynapi:parameter ; + dynapi:name "offset" ; + dynapi:defaultValue "0" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "offset"@en-US . + + + a dynapi:parameter ; + dynapi:name "sortBy" ; + dynapi:defaultValue "label" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "sortBy"@en-US . + + + a dynapi:parameter ; + dynapi:name "order" ; + dynapi:defaultValue "ASC" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType ; + rdfs:label "order"@en-US . + +########################### +## Delete request fields ## +########################### + + + a dynapi:Model ; + dynapi:name "person_graph" ; + dynapi:hasType . + +############################################### +### POSITION FIELDS +############################################### + +# Internal + + + a dynapi:Parameter ; + dynapi:name "organizationUnitURI_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "organizationUnitURI" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "organizationUnitName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "organizationUnitName" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionName_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "positionName" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionType_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "positionType" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "startDate_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "startDate" ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "endDate_key" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:defaultValue "endDate" ; + dynapi:hasType . + +# Provided + + + a dynapi:Parameter ; + dynapi:name "organizationUnitURI" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "organizationUnitName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionName" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "positionType" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "startDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . + + + a dynapi:Parameter ; + dynapi:name "endDate" ; + dynapi:defaultValue "" ; + dynapi:isInternal "true"^^xsd:boolean ; + dynapi:isOptionalParam "true"^^xsd:boolean ; + dynapi:hasType . 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 index 7ceb3bdb2..f0d8b62e4 100644 --- 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 @@ -95,7 +95,7 @@ a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person positions are defined"@en-US ; - dynapi:requiresParameter . + dynapi:requiresParameter . # Person position container keys 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..6728d5bb2 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_add_person_position.n3 @@ -0,0 +1,128 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################################ +#Add person position + + + a dynapi:Procedure ; + dynapi:hasFirstStep . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:N3Template ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:N3TextAdditions + """ + @prefix dynapi: . + @prefix rdfs: . + + ?current_step_uri ; + ?positionType ; + ?positionName ; + ?organizationUnitName ; + ?organizationUnitURI ; + ?startDate ; + ?endDate . + + """ . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:N3Template ; + dynapi:hasModel ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + 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..dbbf0f540 --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_contains_position_item.n3 @@ -0,0 +1,35 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################################ +#Condition procedure + + + a dynapi:Procedure ; + dynapi:providesParameter ; + dynapi:hasFirstStep . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:SumOperation ; + dynapi:requiresParameter ; + dynapi:requiresParameter ; + dynapi:providesParameter . + + + a dynapi:ConditionContainerContains ; + dynapi:targetContainer ; + dynapi:requiresParameter . 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..98a34d8dc --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_get_position_from_container.n3 @@ -0,0 +1,25 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################################ +#Get position from a container + + + a dynapi:Procedure ; + dynapi:hasFirstStep ; + dynapi:providesParameter . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . + + + a dynapi:ContainerQuery ; + dynapi:providesParameter ; + dynapi:targetContainer ; + dynapi:requiresParameter . \ 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..76bccfa9f --- /dev/null +++ b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_update_person_position.n3 @@ -0,0 +1,89 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix owl: . +@prefix vitro: . +@prefix dynapi: . +@prefix dynapi_java: . +@prefix xsd: . + +############################################################ +#Update person position + + + a dynapi:Procedure ; + dynapi:hasFirstStep . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:ConditionalStep ; + dynapi:nextIfSatisfied ; + dynapi:nextIfNotSatisfied ; + dynapi:hasCondition . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasNextStep ; + dynapi:hasOperation . + + + a dynapi:OperationalStep ; + dynapi:hasOperation . From 6284dd96eef0db8eb0545c343bdf14a2ecf464b0 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 22 Sep 2023 19:09:50 +0200 Subject: [PATCH 36/38] Refactoring person n3 files. Switched deletion fetch to full union. --- .../endpoint_procedure_delete_event.n3 | 2 +- ...oint_procedure_delete_organisation_unit.n3 | 2 +- .../endpoint_procedure_delete_person.n3 | 2 +- .../endpoint_procedure_update_person.n3 | 244 +++++++++--------- .../endpoint_resource_person_parameters.n3 | 166 ++++++------ .../endpoint_resource_person_utils.n3 | 116 +++++---- .../procedure_contains_position_item.n3 | 31 ++- .../procedure_get_position_from_container.n3 | 19 +- 8 files changed, 305 insertions(+), 277 deletions(-) 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 index 2b7040e44..9d4e06694 100644 --- 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 @@ -65,7 +65,7 @@ event_fetching:operation """ ; dynapi:providesParameter deletion_parameter:event_graph ; dynapi:requiresParameter deletion_parameter:resource_id ; - dynapi:hasModel dynapi_model:abox_assertions . + dynapi:hasModel dynapi_model:full_union . event_removal:step a dynapi:OperationalStep ; 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 index e787bec9a..1ad21f83c 100644 --- 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 @@ -53,7 +53,7 @@ fetching_properties:operation """ ; dynapi:providesParameter deletion_parameters:organization_unit_graph ; dynapi:requiresParameter deletion_parameters:resource_id ; - dynapi:hasModel . + dynapi:hasModel . deletion_properties:step a dynapi:OperationalStep ; 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 index 91872cc53..47a0e0387 100644 --- 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 @@ -76,7 +76,7 @@ get_from_graph:operation """ ; dynapi:providesParameter person_parameter:person_graph ; dynapi:requiresParameter person_parameter:resource_id ; - dynapi:hasModel . + dynapi:hasModel . remove_from_graph:step a dynapi:OperationalStep ; 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 index c76929740..b072691b9 100644 --- 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 @@ -5,6 +5,16 @@ @prefix dynapi: . @prefix dynapi_java: . @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 @@ -13,256 +23,256 @@ a dynapi:Procedure ; rdfs:label "Updating a person"@en-US ; - dynapi:accessWhitelist ; - dynapi:hasFirstStep . + dynapi:accessWhitelist whitelist_access:admin ; + dynapi:hasFirstStep get_from_graph:step . - +get_from_graph:step a dynapi:OperationalStep ; - dynapi:hasNextStep ; + dynapi:hasNextStep remove_from_graph:step ; dynapi:hasOperation . - +remove_from_graph:step a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . + dynapi:hasNextStep unload_from_proc_pool:step ; + dynapi:hasOperation remove_from_graph:operation . - +remove_from_graph:operation a dynapi:ModelWriter ; - dynapi:retractionModel ; + dynapi:retractionModel request_parameter:person_graph ; dynapi:targetModel . - +unload_from_proc_pool:step a dynapi:OperationalStep ; - dynapi:hasNextStep ; - dynapi:hasOperation . + 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 . + dynapi:requiresParameter request_parameter:resource_id . - +creation_properties:step1 a dynapi:OperationalStep ; rdfs:label "creation of a person step 1"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasNextStep . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasNextStep . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasNextStep . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasNextStep . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasNextStep . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasNextStep . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasNextStep . + 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 ; - dynapi:hasCondition . + dynapi:nextIfSatisfied creation_properties:step9 ; + dynapi:hasCondition condition:researcher_id_check . - +creation_properties:step9 a dynapi:OperationalStep ; rdfs:label "creation of a person step 9"@en-US ; - dynapi:hasOperation ; - dynapi:hasNextStep . + 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 ; - dynapi:hasCondition . + dynapi:nextIfSatisfied creation_properties:step10 ; + dynapi:hasCondition condition:positions_check . - +creation_properties:substitution a dynapi:ParameterSubstitution ; - dynapi:substitutionSource ; - dynapi:substitutionTarget . + dynapi:substitutionSource request_parameter:resource_id ; + dynapi:substitutionTarget request_parameter:current_uri_persisted . - +creation_properties:step10 a dynapi:OperationalStep ; - dynapi:hasParameterSubstitution ; - dynapi:hasOperation ; + 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 ; + dynapi:executableDescriptor create_person_positions:executable_descriptor ; - dynapi:internalParameter ; + dynapi:internalParameter iteration_parameter:iteration_int_param ; - dynapi:internalParameter ; - dynapi:providesParameter . + dynapi:internalParameter iteration_parameter:current_positions_item ; + dynapi:providesParameter iteration_parameter:current_positions_item . - +create_person_positions:executable_descriptor a dynapi:ProcedureDescriptor ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; + 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:requiresParameter ; - dynapi:requiresParameter ; + 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:requiresParameter ; - dynapi:requiresParameter ; + 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:requiresParameter ; - dynapi:requiresParameter ; + 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:requiresParameter ; - dynapi:requiresParameter ; + 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:requiresParameter ; - dynapi:requiresParameter ; + 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:requiresParameter ; - dynapi:requiresParameter ; + 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:requiresParameter ; - dynapi:requiresParameter ; + 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:requiresParameter ; - dynapi:requiresParameter ; + 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:requiresParameter ; - dynapi:requiresParameter ; + 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_parameters.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_parameters.n3 index 93708e727..5c90f8522 100644 --- 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 @@ -1,10 +1,16 @@ +@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 @@ -14,221 +20,221 @@ ## 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:hasType dynapi_type:JsonContainerArray . - +response_parameter:count a dynapi:Parameter ; rdfs:label "Number of fetched persons"@en-US ; dynapi:name "count" ; - dynapi:hasType . + 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: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: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:hasType dynapi_type:integer . - +iteration_parameter:expected_int_result_1 a dynapi:Parameter ; dynapi:name "condition_result" ; dynapi:defaultValue "1" ; - dynapi:hasType . + 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: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:hasType dynapi_type:generated-uri . - +iteration_parameter:current_positions_item a dynapi:Parameter ; dynapi:name "item" ; - dynapi:hasType . + dynapi:hasType dynapi_type:JsonContainer . ##################### ## Creation fields ## ##################### - +request_parameter:current_uri_persisted a dynapi:Parameter ; dynapi:name "current_uri_persisted" ; - dynapi:hasType . + 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:hasType dynapi_type:generated-uri . - +request_parameter:label a dynapi:Parameter ; dynapi:name "label" ; - dynapi:hasType . + 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: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: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: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: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: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: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: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: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:hasType dynapi_type:string-literal . ######################### ## Read request fields ## ######################### - +request_parameter:resource_id a dynapi:Parameter ; dynapi:name "resource_id" ; - dynapi:hasType ; + dynapi:hasType dynapi_type:uri ; rdfs:label "resource uri"@en-US . - +request_parameter:total a dynapi:parameter ; dynapi:name "total" ; - dynapi:hasType ; + 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: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: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: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: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:hasType dynapi_type:model . ############################################### ### POSITION FIELDS @@ -236,94 +242,94 @@ # Internal - +position_request_param:organizationUnitURI_key a dynapi:Parameter ; dynapi:name "organizationUnitURI_key" ; dynapi:isInternal "true"^^xsd:boolean ; dynapi:defaultValue "organizationUnitURI" ; - dynapi:hasType . + 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: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: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: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: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: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: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: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: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: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: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: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 index f0d8b62e4..7f8b3e93d 100644 --- 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 @@ -5,6 +5,12 @@ @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: . ########################## ## Unpacking operations ## @@ -12,39 +18,39 @@ a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:organizationUnitURI_key ; + dynapi:providesParameter position_parameter:organizationUnitURI . a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:organizationUnitName_key ; + dynapi:providesParameter position_parameter:organizationUnitName . a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:positionName_key ; + dynapi:providesParameter position_parameter:positionName . a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:positionType_key ; + dynapi:providesParameter position_parameter:positionType . a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:startDate_key ; + dynapi:providesParameter position_parameter:startDate . a dynapi:ContainerQuery ; - dynapi:targetContainer ; - dynapi:requiresParameter ; - dynapi:providesParameter . + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:endDate_key ; + dynapi:providesParameter position_parameter:endDate . ############################################### ### PARAMETER CHECKS @@ -52,87 +58,87 @@ # Person attributes - +person_condition:first_name_check a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person first name is defined"@en-US ; - dynapi:requiresParameter . + 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 . + 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 . + 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 . + 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 . + dynapi:requiresParameter person_parameter:internalID . - +person_condition:orcid_check a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person ORCID is defined"@en-US ; - dynapi:requiresParameter . + 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 . + 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 . + dynapi:requiresParameter person_parameter:ResearcherID . - +person_condition:positions_check a dynapi:ConditionIsNotEmpty ; rdfs:label "condition if person positions are defined"@en-US ; - dynapi:requiresParameter . + dynapi:requiresParameter person_parameter:positions . # Person position container keys - +position_condition:contains_organisation_unit_uri_key a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . + 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 ; - dynapi:requiresParameter . + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:organizationUnitName_key . - +position_condition:contains_position_name_key a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:positionName_key . - +position_condition:contains_position_type_key a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:positionType_key . - +position_condition:contains_start_date_key a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . + dynapi:targetContainer iteration_parameter:current_positions_item ; + dynapi:requiresParameter position_parameter:startDate_key . - +position_condition:contains_end_date_key a dynapi:ConditionContainerContains ; - dynapi:targetContainer ; - dynapi:requiresParameter . + 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_contains_position_item.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person_position/procedure/procedure_contains_position_item.n3 index dbbf0f540..2a9db42e6 100644 --- 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 @@ -5,31 +5,34 @@ @prefix dynapi: . @prefix dynapi_java: . @prefix xsd: . +@prefix contains_position_item: . +@prefix iteration_parameter: . +@prefix request_parameter: . ############################################################ #Condition procedure a dynapi:Procedure ; - dynapi:providesParameter ; - dynapi:hasFirstStep . + 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 ; - dynapi:hasCondition . + 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 . + dynapi:hasOperation contains_position_item:addOperation . - +contains_position_item:addOperation a dynapi:SumOperation ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:providesParameter . + 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 ; - dynapi:requiresParameter . + 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 index 98a34d8dc..1f51e6691 100644 --- 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 @@ -5,21 +5,24 @@ @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 ; - dynapi:providesParameter . + dynapi:hasFirstStep get_position_from_container:step ; + dynapi:providesParameter iteration_parameter:current_positions_item . - +get_position_from_container:step a dynapi:OperationalStep ; - dynapi:hasOperation . + dynapi:hasOperation get_position_from_container:operation . - +get_position_from_container:operation a dynapi:ContainerQuery ; - dynapi:providesParameter ; - dynapi:targetContainer ; - dynapi:requiresParameter . \ No newline at end of file + 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 From d76add0a33bb542df8e01611479323faa6bb117a Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 25 Sep 2023 14:55:15 +0200 Subject: [PATCH 37/38] Finished refactoring. Fixed person creation bug when providing an incomplete JSON. --- ...oint_procedure_delete_organisation_unit.n3 | 5 +- ...t_procedure_read_all_organisation_units.n3 | 5 +- ...dpoint_procedure_read_organisation_unit.n3 | 3 +- .../endpoint_procedure_create_person.n3 | 22 +-- .../endpoint_procedure_delete_person.n3 | 5 +- .../endpoint_procedure_read_all_persons.n3 | 5 +- .../endpoint_procedure_read_person.n3 | 3 +- .../endpoint_procedure_update_person.n3 | 22 +-- .../endpoint_resource_person_utils.n3 | 13 +- .../procedure_add_person_position.n3 | 130 ++++++++++-------- .../procedure_update_person_position.n3 | 99 ++++++------- 11 files changed, 167 insertions(+), 145 deletions(-) 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 index 1ad21f83c..1d788873f 100644 --- 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 @@ -4,6 +4,7 @@ @prefix vitro: . @prefix dynapi: . @prefix dynapi_java: . +@prefix dynapi_model: . @prefix xsd: . @prefix fetching_properties: . @prefix deletion_properties: . @@ -53,7 +54,7 @@ fetching_properties:operation """ ; dynapi:providesParameter deletion_parameters:organization_unit_graph ; dynapi:requiresParameter deletion_parameters:resource_id ; - dynapi:hasModel . + dynapi:hasModel dynapi_model:full_union . deletion_properties:step a dynapi:OperationalStep ; @@ -63,7 +64,7 @@ deletion_properties:step deletion_properties:operation a dynapi:ModelWriter ; dynapi:retractionModel deletion_parameters:organization_unit_graph ; - dynapi:targetModel . + dynapi:targetModel dynapi_model:abox_assertions . unloading_properties:step a dynapi:OperationalStep ; 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 index 29c2c26bb..e4e77559a 100644 --- 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 @@ -4,6 +4,7 @@ @prefix vitro: . @prefix dynapi: . @prefix dynapi_java: . +@prefix dynapi_model: . @prefix xsd: . @prefix response_parameters: . @prefix read_parameters: . @@ -32,7 +33,7 @@ fetching_properties:step fetching_properties:sparql_select_query a dynapi:SparqlSelectQuery ; rdfs:label "read OUs sparql query"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:full_union ; dynapi:providesParameter response_parameters:organizationUnits ; dynapi:requiresPlainParameter read_parameters:limit ; dynapi:requiresPlainParameter read_parameters:offset ; @@ -66,7 +67,7 @@ statistics:step statistics:sparql_query a dynapi:SparqlSelectQuery ; rdfs:label "number of OUs sparql query 1"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:full_union ; dynapi:providesParameter response_parameters:count ; dynapi:sparqlQueryText """ 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 index a0acb4486..1aee1303d 100644 --- 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 @@ -4,6 +4,7 @@ @prefix vitro: . @prefix dynapi: . @prefix dynapi_java: . +@prefix dynapi_model: . @prefix xsd: . @prefix fetching_properties: . @prefix whitelist_access: . @@ -29,7 +30,7 @@ fetching_properties:step fetching_properties:sparql_query a dynapi:SparqlSelectQuery ; rdfs:label "read OU sparql query 1"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:full_union ; dynapi:requiresParameter fetching_parameters:resource_id ; dynapi:providesParameter response_parameters:organizationUnits ; dynapi:sparqlQueryText 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 index feb2a2c73..d20ba93dd 100644 --- 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 @@ -4,6 +4,7 @@ @prefix vitro: . @prefix dynapi: . @prefix dynapi_java: . +@prefix dynapi_model: . @prefix xsd: . @prefix creation_properties: . @prefix execute_template: . @@ -110,7 +111,7 @@ creation_properties:step7 creation_properties:conditional_for_step8 a dynapi:ConditionalStep ; - rdfs:label "conditional step for person first name check"@en-US ; + 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 . @@ -125,6 +126,7 @@ 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 @@ -201,7 +203,7 @@ create_person_positions:executable_descriptor execute_template:n3_template_subject a dynapi:N3Template ; rdfs:label "create person N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter person_parameter:uri ; dynapi:requiresParameter person_parameter:label ; dynapi:N3TextAdditions @@ -213,7 +215,7 @@ execute_template:n3_template_subject execute_template:n3_template_first_name a dynapi:N3Template ; rdfs:label "create person first name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter person_parameter:uri ; dynapi:requiresParameter person_parameter:first_name ; dynapi:N3TextAdditions "?uri ?first_name . " . @@ -221,7 +223,7 @@ execute_template:n3_template_first_name execute_template:n3_template_middle_name a dynapi:N3Template ; rdfs:label "create person middle name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter person_parameter:uri ; dynapi:requiresParameter person_parameter:middle_name ; dynapi:N3TextAdditions "?uri ?middle_name . " . @@ -229,7 +231,7 @@ execute_template:n3_template_middle_name execute_template:n3_template_last_name a dynapi:N3Template ; rdfs:label "create person last name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter person_parameter:uri ; dynapi:requiresParameter person_parameter:last_name ; dynapi:N3TextAdditions "?uri ?last_name . " . @@ -237,7 +239,7 @@ execute_template:n3_template_last_name execute_template:n3_template_type a dynapi:N3Template ; rdfs:label "create person type N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter person_parameter:uri ; dynapi:requiresParameter person_parameter:type ; dynapi:N3TextAdditions "?uri ?type . " . @@ -245,7 +247,7 @@ execute_template:n3_template_type execute_template:n3_template_internal_id a dynapi:N3Template ; rdfs:label "create person internal id N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter person_parameter:uri ; dynapi:requiresParameter person_parameter:internalID ; dynapi:N3TextAdditions "?uri ?internalID . " . @@ -253,7 +255,7 @@ execute_template:n3_template_internal_id execute_template:n3_template_orcid a dynapi:N3Template ; rdfs:label "create person ORCID N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter person_parameter:uri ; dynapi:requiresParameter person_parameter:ORCID ; dynapi:N3TextAdditions "?uri ?ORCID . " . @@ -261,7 +263,7 @@ execute_template:n3_template_orcid execute_template:n3_template_scopus_id a dynapi:N3Template ; rdfs:label "create person SCOPUS author ID N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter person_parameter:uri ; dynapi:requiresParameter person_parameter:SCOPUSAuthorID ; dynapi:N3TextAdditions "?uri ?SCOPUSAuthorID . " . @@ -269,7 +271,7 @@ execute_template:n3_template_scopus_id execute_template:n3_template_researcher_id a dynapi:N3Template ; rdfs:label "create person researcher ID N3 Template"@en-US ; - dynapi:hasModel ; + 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 index 47a0e0387..9528520fa 100644 --- 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 @@ -4,6 +4,7 @@ @prefix vitro: . @prefix dynapi: . @prefix dynapi_java: . +@prefix dynapi_model: . @prefix xsd: . @prefix get_from_graph: . @prefix remove_from_graph: . @@ -76,7 +77,7 @@ get_from_graph:operation """ ; dynapi:providesParameter person_parameter:person_graph ; dynapi:requiresParameter person_parameter:resource_id ; - dynapi:hasModel . + dynapi:hasModel dynapi_model:full_union . remove_from_graph:step a dynapi:OperationalStep ; @@ -86,7 +87,7 @@ remove_from_graph:step remove_from_graph:operation a dynapi:ModelWriter ; dynapi:retractionModel person_parameter:person_graph ; - dynapi:targetModel . + dynapi:targetModel dynapi_model:abox_assertions . unload_from_graph:step a dynapi:OperationalStep ; 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 index 682eb1a38..67ec4f314 100644 --- 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 @@ -4,6 +4,7 @@ @prefix vitro: . @prefix dynapi: . @prefix dynapi_java: . +@prefix dynapi_model: . @prefix xsd: . @prefix fetching_properties: . @prefix response_parameter: . @@ -32,7 +33,7 @@ fetching_properties:step fetching_properties:sparql_select_query a dynapi:SparqlSelectQuery ; rdfs:label "read persons sparql query"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:full_union ; dynapi:providesParameter response_parameter:persons ; dynapi:requiresPlainParameter request_parameter:limit ; dynapi:requiresPlainParameter request_parameter:offset ; @@ -99,7 +100,7 @@ statistics:step statistics:sparql_query a dynapi:SparqlSelectQuery ; rdfs:label "number of persons sparql query 1"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:full_union ; dynapi:providesParameter response_parameter:count ; dynapi:sparqlQueryText """ 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 index 2de4f6532..ed1c7568e 100644 --- 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 @@ -4,6 +4,7 @@ @prefix vitro: . @prefix dynapi: . @prefix dynapi_java: . +@prefix dynapi_model: . @prefix xsd: . @prefix fetching_properties: . @prefix whitelist_access: . @@ -29,7 +30,7 @@ fetching_properties:step fetching_properties:sparql_query a dynapi:SparqlSelectQuery ; rdfs:label "read person sparql query 1"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:full_union ; dynapi:requiresParameter request_parameter:resource_id ; dynapi:providesParameter response_parameter:persons ; dynapi:sparqlQueryText 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 index b072691b9..ce4494146 100644 --- 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 @@ -4,6 +4,7 @@ @prefix vitro: . @prefix dynapi: . @prefix dynapi_java: . +@prefix dynapi_model: . @prefix xsd: . @prefix get_from_graph: . @prefix remove_from_graph: . @@ -39,7 +40,7 @@ remove_from_graph:step remove_from_graph:operation a dynapi:ModelWriter ; dynapi:retractionModel request_parameter:person_graph ; - dynapi:targetModel . + dynapi:targetModel dynapi_model:abox_assertions . unload_from_proc_pool:step a dynapi:OperationalStep ; @@ -152,6 +153,7 @@ 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 @@ -204,7 +206,7 @@ create_person_positions:executable_descriptor execute_template:n3_template_subject a dynapi:N3Template ; rdfs:label "update person N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter request_parameter:resource_id ; dynapi:requiresParameter request_parameter:label ; dynapi:N3TextAdditions @@ -216,7 +218,7 @@ execute_template:n3_template_subject execute_template:n3_template_first_name a dynapi:N3Template ; rdfs:label "update person first name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter request_parameter:resource_id ; dynapi:requiresParameter request_parameter:first_name ; dynapi:N3TextAdditions "?resource_id ?first_name . " . @@ -224,7 +226,7 @@ execute_template:n3_template_first_name execute_template:n3_template_middle_name a dynapi:N3Template ; rdfs:label "update person middle name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter request_parameter:resource_id ; dynapi:requiresParameter request_parameter:middle_name ; dynapi:N3TextAdditions "?resource_id ?middle_name . " . @@ -232,7 +234,7 @@ execute_template:n3_template_middle_name execute_template:n3_template_last_name a dynapi:N3Template ; rdfs:label "update person last name N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter request_parameter:resource_id ; dynapi:requiresParameter request_parameter:last_name ; dynapi:N3TextAdditions "?resource_id ?last_name . " . @@ -240,7 +242,7 @@ execute_template:n3_template_last_name execute_template:n3_template_type a dynapi:N3Template ; rdfs:label "update person type N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter request_parameter:resource_id ; dynapi:requiresParameter request_parameter:type ; dynapi:N3TextAdditions "?resource_id ?type . " . @@ -248,7 +250,7 @@ execute_template:n3_template_type execute_template:n3_template_internal_id a dynapi:N3Template ; rdfs:label "update person internal id N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter request_parameter:resource_id ; dynapi:requiresParameter request_parameter:internalID ; dynapi:N3TextAdditions "?resource_id ?internalID . " . @@ -256,7 +258,7 @@ execute_template:n3_template_internal_id execute_template:n3_template_orcid a dynapi:N3Template ; rdfs:label "update person ORCID N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter request_parameter:resource_id ; dynapi:requiresParameter request_parameter:ORCID ; dynapi:N3TextAdditions "?resource_id ?ORCID . " . @@ -264,7 +266,7 @@ execute_template:n3_template_orcid execute_template:n3_template_scopus_id a dynapi:N3Template ; rdfs:label "update person SCOPUS author ID N3 Template"@en-US ; - dynapi:hasModel ; + dynapi:hasModel dynapi_model:abox_assertions ; dynapi:requiresParameter request_parameter:resource_id ; dynapi:requiresParameter request_parameter:SCOPUSAuthorID ; dynapi:N3TextAdditions "?resource_id ?SCOPUSAuthorID . " . @@ -272,7 +274,7 @@ execute_template:n3_template_scopus_id execute_template:n3_template_researcher_id a dynapi:N3Template ; rdfs:label "update person researcher ID N3 Template"@en-US ; - dynapi:hasModel ; + 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_utils.n3 b/home/src/main/resources/rdf/dynapiAbox/everytime/person/resource/endpoint_resource_person_utils.n3 index 7f8b3e93d..ff6757bfb 100644 --- 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 @@ -11,42 +11,43 @@ @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 ; 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 index 6728d5bb2..5d496b627 100644 --- 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 @@ -4,96 +4,104 @@ @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 . + dynapi:hasFirstStep add_person_position:contains_organisation_unit_uri_key . - +add_person_position:contains_organisation_unit_uri_key a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:hasOperation . + 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:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; + 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: . @@ -109,15 +117,15 @@ """ . - +add_person_position:bind_position_construct_query a dynapi:OperationalStep ; - dynapi:hasOperation . + dynapi:hasOperation execute_template:bind_position_construct_query . - +execute_template:bind_position_construct_query a dynapi:N3Template ; - dynapi:hasModel ; - dynapi:requiresParameter ; - dynapi:requiresParameter ; + dynapi:hasModel dynapi_model:abox_assertions ; + dynapi:requiresParameter person_parameter:current_uri_persisted ; + dynapi:requiresParameter iteration_parameter:current_step_uri ; dynapi:N3TextAdditions """ @prefix dynapi: . 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 index 76bccfa9f..4bc860c53 100644 --- 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 @@ -5,85 +5,88 @@ @prefix dynapi: . @prefix dynapi_java: . @prefix xsd: . +@prefix update_person_position: . +@prefix condition: . +@prefix unpacking_properties: . ############################################################ #Update person position a dynapi:Procedure ; - dynapi:hasFirstStep . + dynapi:hasFirstStep update_person_position:contains_organisation_unit_uri_key . - +update_person_position:contains_organisation_unit_uri_key a dynapi:ConditionalStep ; - dynapi:nextIfSatisfied ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:nextIfNotSatisfied ; - dynapi:hasCondition . + 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 ; - dynapi:hasOperation . + 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 ; - dynapi:hasOperation . + dynapi:hasNextStep update_person_position:bind_position_construct_query ; + dynapi:hasOperation . - +update_person_position:bind_position_construct_query a dynapi:OperationalStep ; - dynapi:hasOperation . + dynapi:hasOperation . From aa48c89a6b1efd11e06bc2f11bf71a591daee267 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 4 Oct 2023 15:35:10 +0200 Subject: [PATCH 38/38] Fixed person position reading bug. --- .../person/procedure/endpoint_procedure_read_all_persons.n3 | 3 +-- .../person/procedure/endpoint_procedure_read_person.n3 | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) 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 index 67ec4f314..5f89a5939 100644 --- 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 @@ -55,7 +55,7 @@ fetching_properties:sparql_select_query GROUP_CONCAT(DISTINCT CONCAT( '{"organizationUnitURI":"', IF(BOUND(?organizationUnitURI), STR(?organizationUnitURI), ''), - '", "organizationUnitName":"', IF(BOUND(?positionName), STR(?positionName), ''), + '", "organizationUnitName":"', IF(BOUND(?organisationUnitName), STR(?organisationUnitName), ''), '", "positionName":"', IF(BOUND(?positionName), STR(?positionName), ''), '", "positionType":"', IF(BOUND(?positionType), STR(?positionType), ''), '", "startDate":"', IF(BOUND(?startDate), STR(?startDate), ''), @@ -89,7 +89,6 @@ fetching_properties:sparql_select_query GROUP BY ?uri ORDER BY ?label LIMIT ?limit OFFSET ?offset - """ . statistics:step 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 index ed1c7568e..a36e0060a 100644 --- 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 @@ -35,7 +35,7 @@ fetching_properties:sparql_query dynapi:providesParameter response_parameter:persons ; dynapi:sparqlQueryText """ - SELECT ?uri (GROUP_CONCAT(DISTINCT ?personType; separator=" -> ") as ?type) + SELECT ?uri (GROUP_CONCAT(DISTINCT ?personType; separator=" -> ") as ?type) (SAMPLE(?personlabel) as ?label) (SAMPLE(?firstName) as ?first_name) (SAMPLE(?middleName) as ?middle_name) @@ -48,7 +48,7 @@ fetching_properties:sparql_query GROUP_CONCAT(DISTINCT CONCAT( '{"organizationUnitURI":"', IF(BOUND(?organizationUnitURI), STR(?organizationUnitURI), ''), - '", "organizationUnitName":"', IF(BOUND(?positionName), STR(?positionName), ''), + '", "organizationUnitName":"', IF(BOUND(?organisationUnitName), STR(?organisationUnitName), ''), '", "positionName":"', IF(BOUND(?positionName), STR(?positionName), ''), '", "positionType":"', IF(BOUND(?positionType), STR(?positionType), ''), '", "startDate":"', IF(BOUND(?startDate), STR(?startDate), ''),