diff --git a/.fossa.yml b/.fossa.yml index 005b660973c55b1ecb92b77bff52c5159978f3db..09b5fc51ab43d1499d01a0da799b7402cee5c50b 100644 --- a/.fossa.yml +++ b/.fossa.yml @@ -32,3 +32,7 @@ analyze: type: mvn target: provider/indexer-ibm/pom.xml path: . + - name: indexer-reference + type: mvn + target: provider/indexer-reference/pom.xml + path: . diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd9ed5237bca01c5868c7034c090b2045df56c54..52342cee8e791f9d7f0706da78bc0d442ef2d9c7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,7 @@ variables: OSDU_GCP_STORAGE_RECORDS_BATCH_SIZE: 20 OSDU_GCP_DATA_GROUP: osdu OSDU_GCP_ENV_VARS: AUTHORIZE_API=$OSDU_GCP_ENTITLEMENTS_URL,GOOGLE_CLOUD_PROJECT=$OSDU_GCP_PROJECT,REDIS_SEARCH_HOST=$REDIS_SEARCH_HOST,REDIS_GROUP_HOST=$REDIS_GROUP_HOST,SECURITY_HTTPS_CERTIFICATE_TRUST=$OSDU_SECURITY_HTTPS_CERTIFICATE_TRUST,INDEXER_HOST=$OSDU_GCP_INDEXER_HOST,STORAGE_QUERY_RECORD_HOST=$OSDU_GCP_STORAGE_QUERY_RECORD_HOST,STORAGE_SCHEMA_HOST=$OSDU_GCP_STORAGE_SCHEMA_HOST,STORAGE_QUERY_RECORD_FOR_CONVERSION_HOST=$OSDU_GCP_STORAGE_QUERY_RECORD_FOR_CONVERSION_HOST,STORAGE_HOSTNAME=$OSDU_GCP_STORAGE_HOSTNAME,STORAGE_RECORDS_BATCH_SIZE=$OSDU_GCP_STORAGE_RECORDS_BATCH_SIZE,INDEXER_QUEUE_HOST=$OSDU_GCP_INDEXER_QUEUE_HOST,LEGALTAG_API=$OSDU_GCP_LEGALTAG_API,CRS_API=$OSDU_GCP_CRS_API,DATA_GROUP=$OSDU_GCP_DATA_GROUP,GOOGLE_AUDIENCES=$GOOGLE_AUDIENCE,INDEXER_QUE_SERVICE_MAIL=$OSDU_GCP_QUEUE_SA_EMAIL,SCHEMA_HOST=$OSDU_GCP_SCHEMA_URL/api/schema-service/v1/schema --vpc-connector=$OSDU_GCP_VPC_CONNECTOR + OSDU_GCP_TEST_SUBDIR: testing/$OSDU_GCP_SERVICE-test-$OSDU_GCP_VENDOR IBM_BUILD_SUBDIR: provider/indexer-ibm IBM_INT_TEST_SUBDIR: testing/indexer-test-ibm diff --git a/NOTICE b/NOTICE index cbd4bf4a82a797ceb9a2f1bec0bd42363cd633ec..6b22e74c2e0fad3759f5f580c6e8c2c67c6b8cb6 100644 --- a/NOTICE +++ b/NOTICE @@ -180,6 +180,7 @@ The following software have components provided under the terms of this license: - Apache Commons BeanUtils (from http://commons.apache.org/proper/commons-beanutils/) - Apache Commons CLI (from http://commons.apache.org/proper/commons-cli/) - Apache Commons Codec (from http://commons.apache.org/proper/commons-codec/) +- Apache Commons Collections (from http://commons.apache.org/proper/commons-collections/) - Apache Commons Lang (from http://commons.apache.org/proper/commons-lang/) - Apache Commons Logging (from http://commons.apache.org/proper/commons-logging/) - Apache Commons Validator (from http://commons.apache.org/proper/commons-validator/) @@ -210,6 +211,7 @@ The following software have components provided under the terms of this license: - AutoValue (from ) - Azure AD Spring Security Integration Spring Boot Starter (from https://github.com/Microsoft/azure-spring-boot) - Azure Metrics Spring Boot Starter (from https://github.com/Microsoft/azure-spring-boot) +- BSON (from http://bsonspec.org) - Bean Validation API (from http://beanvalidation.org) - Byte Buddy (without dependencies) (from ) - Byte Buddy Java agent (from ) @@ -231,21 +233,29 @@ The following software have components provided under the terms of this license: - Doxia :: XDoc Module (from ) - Doxia :: XHTML Module (from ) - Elastic JNA Distribution (from https://github.com/java-native-access/jna) +- Elastic JNA Distribution (from https://github.com/java-native-access/jna) +- Elasticsearch: 5.0.0-alpha5 (from https://github.com/elastic/elasticsearch) - Elasticsearch: 5.0.0-alpha5 (from https://github.com/elastic/elasticsearch) - FindBugs-jsr305 (from http://findbugs.sourceforge.net/) - Google APIs Client Library for Java (from ) +- Google APIs Client Library for Java (from ) +- Google App Engine extensions to the Google HTTP Client Library for Java. (from ) - Google App Engine extensions to the Google HTTP Client Library for Java. (from ) - Google Cloud Core (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core) - Google Cloud Core HTTP (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-http) +- Google Cloud Core HTTP (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-http) - Google Cloud Core gRPC (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-grpc) - Google Cloud Datastore (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-datastore) +- Google Cloud Datastore (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-datastore) - Google Cloud Key Management Service (KMS) API v1-rev22-1.23.0 (from ) - Google Cloud Logging (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-logging) - Google Cloud Pub/Sub (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-pubsub) +- Google Cloud Pub/Sub (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-pubsub) - Google Cloud Storage (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-storage) - Google HTTP Client Library for Java (from https://github.com/google/google-http-java-client.git) - Google HTTP Client Library for Java (from https://github.com/google/google-http-java-client.git) - Google OAuth Client Library for Java (from ) +- Google OAuth Client Library for Java (from ) - Gson (from https://github.com/google/gson) - Gson (from https://github.com/google/gson) - Guava InternalFutureFailureAccess and InternalFutures (from ) @@ -253,6 +263,7 @@ The following software have components provided under the terms of this license: - Guava: Google Core Libraries for Java (from https://github.com/google/guava.git) - Guava: Google Core Libraries for Java (from https://github.com/google/guava.git) - HPPC Collections (from http://labs.carrotsearch.com) +- HPPC Collections (from http://labs.carrotsearch.com) - Hibernate Validator Engine (from ) - IBM COS Java SDK for Amazon S3 (from https://github.com/ibm/ibm-cos-sdk-java) - IBM COS Java SDK for COS KMS (from https://github.com/ibm/ibm-cos-sdk-java) @@ -274,6 +285,7 @@ The following software have components provided under the terms of this license: - Jackson (from http://jackson.codehaus.org) - Jackson (from http://jackson.codehaus.org) - Jackson 2 extensions to the Google HTTP Client Library for Java. (from https://github.com/google/google-http-java-client.git/google-http-client-jackson2) +- Jackson 2 extensions to the Google HTTP Client Library for Java. (from https://github.com/google/google-http-java-client.git/google-http-client-jackson2) - Jackson dataformat: CBOR (from http://github.com/FasterXML/jackson-dataformats-binary) - Jackson dataformat: CBOR (from http://github.com/FasterXML/jackson-dataformats-binary) - Jackson datatype: JSR310 (from http://wiki.fasterxml.com/JacksonModuleJSR310) @@ -300,6 +312,7 @@ The following software have components provided under the terms of this license: - Java Native Access (from https://github.com/java-native-access/jna) - Java Native Access Platform (from https://github.com/java-native-access/jna) - Java Servlet API (from http://servlet-spec.java.net) +- Java UUID Generator (from http://wiki.fasterxml.com/JugHome) - Javassist (from http://www.javassist.org/) - Javassist (from http://www.javassist.org/) - Jetty Server (from ) @@ -316,19 +329,34 @@ The following software have components provided under the terms of this license: - Logback Contrib :: JSON :: Core (from ) - Logback Contrib :: Jackson (from ) - Lucene Common Analyzers (from ) +- Lucene Common Analyzers (from ) +- Lucene Core (from ) - Lucene Core (from ) - Lucene Grouping (from ) +- Lucene Grouping (from ) +- Lucene Highlighter (from ) - Lucene Highlighter (from ) - Lucene Join (from ) +- Lucene Join (from ) +- Lucene Memory (from ) +- Lucene Memory (from ) - Lucene Memory (from ) - Lucene Memory (from ) - Lucene Miscellaneous (from ) +- Lucene Miscellaneous (from ) +- Lucene Queries (from ) - Lucene Queries (from ) - Lucene QueryParsers (from ) +- Lucene QueryParsers (from ) +- Lucene Sandbox (from ) - Lucene Sandbox (from ) +- Lucene Spatial (from ) - Lucene Spatial 3D (from ) +- Lucene Spatial 3D (from ) +- Lucene Spatial Extras (from ) - Lucene Spatial Extras (from ) - Lucene Suggest (from ) +- Lucene Suggest (from ) - MapStruct Core (from ) - Maven Artifact (from ) - Maven Artifact Manager (from ) @@ -350,13 +378,16 @@ The following software have components provided under the terms of this license: - Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) +- Microsoft Azure Java Core Library (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure Netty HTTP Client Library (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure SDK for SQL API of Azure Cosmos DB Service (from https://github.com/Azure/azure-sdk-for-java) -- Mockito (from http://www.mockito.org) - Mockito (from http://mockito.org) - Mockito (from http://mockito.org) - Mockito (from http://mockito.org) +- Mockito (from http://www.mockito.org) - Mojo's Maven plugin for Cobertura (from http://mojo.codehaus.org/cobertura-maven-plugin/) +- MongoDB Driver (from http://www.mongodb.org) +- MongoDB Java Driver Core (from http://www.mongodb.org) - Netty Reactive Streams HTTP support (from ) - Netty Reactive Streams Implementation (from ) - Netty/Buffer (from http://netty.io/) @@ -402,20 +433,24 @@ The following software have components provided under the terms of this license: - PowerMock (from http://www.powermock.org) - Protocol Buffer extensions to the Google HTTP Client Library for Java. (from ) - QpidJMS Client (from ) +- RabbitMQ Java Client (from http://www.rabbitmq.com) - Reactive Streams Netty driver (from https://github.com/reactor/reactor-netty) - Retrofit (from ) - Servlet Specification 2.5 API (from ) - Simple XML (from http://simple.sourceforge.net) - SnakeYAML (from http://www.snakeyaml.org) - Spatial4J (from http://www.locationtech.org/projects/locationtech.spatial4j) +- Spring AMQP Core (from https://projects.spring.io/spring-amqp) - Spring AOP (from https://github.com/spring-projects/spring-framework) - Spring Beans (from https://github.com/spring-projects/spring-framework) - Spring Boot (from http://projects.spring.io/spring-boot/) +- Spring Boot AMQP Starter (from http://projects.spring.io/spring-boot/) - Spring Boot Actuator (from http://projects.spring.io/spring-boot/) - Spring Boot Actuator AutoConfigure (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-actuator-autoconfigure) - Spring Boot Actuator Starter (from http://projects.spring.io/spring-boot/) - Spring Boot AutoConfigure (from http://projects.spring.io/spring-boot/) - Spring Boot Configuration Processor (from http://projects.spring.io/spring-boot/) +- Spring Boot Data MongoDB Starter (from http://projects.spring.io/spring-boot/) - Spring Boot Dependencies (from http://projects.spring.io/spring-boot/) - Spring Boot Jersey Starter (from http://projects.spring.io/spring-boot/) - Spring Boot Json Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-json) @@ -434,11 +469,14 @@ The following software have components provided under the terms of this license: - Spring Core (from https://github.com/spring-projects/spring-framework) - Spring Data Core (from ) - Spring Data Core (from ) +- Spring Data MongoDB - Core (from ) - Spring Expression Language (SpEL) (from https://github.com/spring-projects/spring-framework) - Spring JMS (from https://github.com/spring-projects/spring-framework) - Spring Messaging (from https://github.com/spring-projects/spring-framework) - Spring Plugin - Core (from ) - Spring Plugin - Metadata Extension (from ) +- Spring RabbitMQ Support (from https://projects.spring.io/spring-amqp) +- Spring Retry (from http://www.springsource.org) - Spring Security JWT Library (from http://github.com/spring-projects/spring-security-oauth) - Spring Security JWT Library (from http://github.com/spring-projects/spring-security-oauth) - Spring TestContext Framework (from https://github.com/spring-projects/spring-framework) @@ -452,17 +490,23 @@ The following software have components provided under the terms of this license: - Xerces2-j (from https://xerces.apache.org/xerces2-j/) - aalto-xml (from ) - aggs-matrix-stats (from https://github.com/elastic/elasticsearch) +- aggs-matrix-stats (from https://github.com/elastic/elasticsearch) - aws-ssm-java-caching-client (from https://github.com/awslabs/aws-ssm-java-caching-client) - cli (from https://github.com/elastic/elasticsearch) +- cli (from https://github.com/elastic/elasticsearch) +- com.google.api.grpc:grpc-google-cloud-pubsub-v1 (from https://github.com/googleapis/googleapis) - com.google.api.grpc:grpc-google-cloud-pubsub-v1 (from https://github.com/googleapis/googleapis) - com.google.api.grpc:proto-google-cloud-logging-v2 (from https://github.com/googleapis/googleapis) - com.google.api.grpc:proto-google-cloud-pubsub-v1 (from https://github.com/googleapis/googleapis) +- com.google.api.grpc:proto-google-cloud-pubsub-v1 (from https://github.com/googleapis/googleapis) - com.google.api.grpc:proto-google-common-protos (from https://github.com/googleapis/googleapis) - com.google.api.grpc:proto-google-iam-v1 (from https://github.com/googleapis/googleapis) - commons-collections (from ) - compiler (from http://github.com/spullara/mustache.java) +- compiler (from http://github.com/spullara/mustache.java) - datastore-v1-proto-client (from ) - elasticsearch-core (from https://github.com/elastic/elasticsearch) +- elasticsearch-core (from https://github.com/elastic/elasticsearch) - elasticsearch-geo (from https://github.com/elastic/elasticsearch) - error-prone annotations (from ) - error-prone annotations (from ) @@ -497,6 +541,7 @@ The following software have components provided under the terms of this license: - jersey-spring4 (from ) - jose4j (from https://bitbucket.org/b_c/jose4j/) - lang-mustache (from https://github.com/elastic/elasticsearch) +- lang-mustache (from https://github.com/elastic/elasticsearch) - lettuce (from http://github.com/mp911de/lettuce/wiki) - mapper-extras (from https://github.com/elastic/elasticsearch) - micrometer-core (from https://github.com/micrometer-metrics/micrometer) @@ -504,18 +549,24 @@ The following software have components provided under the terms of this license: - org.xmlunit:xmlunit-core (from http://www.xmlunit.org/) - oro (from ) - parent-join (from https://github.com/elastic/elasticsearch) +- parent-join (from https://github.com/elastic/elasticsearch) - powermock-api-support (from ) - powermock-core (from http://www.powermock.org) - powermock-module-junit4 (from http://www.powermock.org) - powermock-module-junit4-common (from ) - powermock-reflect (from ) - proto-google-cloud-datastore-v1 (from https://github.com/googleapis/api-client-staging) +- proto-google-cloud-datastore-v1 (from https://github.com/googleapis/api-client-staging) - proton-j (from ) - rank-eval (from https://github.com/elastic/elasticsearch) +- rank-eval (from https://github.com/elastic/elasticsearch) +- rest (from https://github.com/elastic/elasticsearch) - rest (from https://github.com/elastic/elasticsearch) - rest-high-level (from https://github.com/elastic/elasticsearch) +- rest-high-level (from https://github.com/elastic/elasticsearch) - rxjava (from https://github.com/ReactiveX/RxJava) - secure-sm (from https://github.com/elastic/elasticsearch) +- secure-sm (from https://github.com/elastic/elasticsearch) - spring-security-config (from http://spring.io/spring-security) - spring-security-core (from http://spring.io/spring-security) - spring-security-oauth2-client (from http://spring.io/spring-security) @@ -539,6 +590,7 @@ The following software have components provided under the terms of this license: - tomcat-embed-el (from http://tomcat.apache.org/) - tomcat-embed-websocket (from http://tomcat.apache.org/) - x-content (from https://github.com/elastic/elasticsearch) +- x-content (from https://github.com/elastic/elasticsearch) - xml-apis (from ) ======================================================================== @@ -550,8 +602,10 @@ The following software have components provided under the terms of this license: - GAX (Google Api eXtensions) (from https://github.com/googleapis) - GAX (Google Api eXtensions) (from https://github.com/googleapis) - GAX (Google Api eXtensions) (from https://github.com/googleapis) +- GAX (Google Api eXtensions) (from https://github.com/googleapis) - Hamcrest Core (from http://hamcrest.org/) - Lucene Common Analyzers (from ) +- Lucene Common Analyzers (from ) - Lucene Core (from ) - Plexus :: Default Container (from ) - Plexus Common Utilities (from http://plexus.codehaus.org/plexus-utils) @@ -577,6 +631,8 @@ The following software have components provided under the terms of this license: - GAX (Google Api eXtensions) (from https://github.com/googleapis) - GAX (Google Api eXtensions) (from https://github.com/googleapis) - GAX (Google Api eXtensions) (from https://github.com/googleapis) +- GAX (Google Api eXtensions) (from https://github.com/googleapis) +- Google APIs Client Library for Java (from ) - Google APIs Client Library for Java (from ) - Google Auth Library for Java - Credentials (from ) - Google Auth Library for Java - OAuth2 HTTP (from ) @@ -585,8 +641,11 @@ The following software have components provided under the terms of this license: - JSch (from http://www.jcraft.com/jsch/) - JavaBeans Activation Framework API jar (from ) - Lucene Common Analyzers (from ) +- Lucene Common Analyzers (from ) +- Lucene Core (from ) - Lucene Core (from ) - Lucene Suggest (from ) +- Lucene Suggest (from ) - Microsoft Application Insights Java SDK Core (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java) @@ -620,6 +679,7 @@ The following software have components provided under the terms of this license: - Checker Qual (from https://checkerframework.org) - FindBugs-jsr305 (from http://findbugs.sourceforge.net/) +- MongoDB Java Driver Core (from http://www.mongodb.org) ======================================================================== CC-BY-4.0 @@ -734,6 +794,7 @@ The following software have components provided under the terms of this license: - JavaMail API (from ) - Mojo's Maven plugin for Cobertura (from http://mojo.codehaus.org/cobertura-maven-plugin/) - OSGi resource locator (from ) +- RabbitMQ Java Client (from http://www.rabbitmq.com) - Run Level Service (from ) - ServiceLocator Default Implementation (from git://java.net/hk2~git/hk2-locator) - aopalliance-repackaged (from ) @@ -773,6 +834,7 @@ The following software have components provided under the terms of this license: - JavaBeans Activation Framework API jar (from ) - JavaMail API (from ) - OSGi resource locator (from ) +- RabbitMQ Java Client (from http://www.rabbitmq.com) - ServiceLocator Default Implementation (from git://java.net/hk2~git/hk2-locator) - aopalliance-repackaged (from ) - javax.annotation-api (from http://jcp.org/en/jsr/detail?id=250) @@ -799,6 +861,13 @@ The following software have components provided under the terms of this license: - Project Lombok (from https://projectlombok.org) - javax.ws.rs-api (from http://jax-rs-spec.java.net) +======================================================================== +JSON +======================================================================== +The following software have components provided under the terms of this license: + +- JSON in Java (from https://github.com/douglascrockford/JSON-java) + ======================================================================== LGPL-2.1-only ======================================================================== @@ -807,6 +876,7 @@ The following software have components provided under the terms of this license: - Cobertura code coverage (from http://cobertura.sourceforge.net) - Commons Lang (from http://commons.apache.org/lang/) - Elastic JNA Distribution (from https://github.com/java-native-access/jna) +- Elastic JNA Distribution (from https://github.com/java-native-access/jna) - Java Native Access (from https://github.com/java-native-access/jna) - Java Native Access Platform (from https://github.com/java-native-access/jna) - Javassist (from http://www.javassist.org/) @@ -838,6 +908,7 @@ The following software have components provided under the terms of this license: - Apache Log4j API (from ) - Apache Log4j Core (from ) +- RabbitMQ Java Client (from http://www.rabbitmq.com) ======================================================================== MIT @@ -848,6 +919,7 @@ The following software have components provided under the terms of this license: - Animal Sniffer Annotations (from ) - Azure AD Spring Security Integration Spring Boot Starter (from https://github.com/Microsoft/azure-spring-boot) - Azure Java Client Authentication Library for AutoRest (from https://github.com/Azure/autorest-clientruntime-for-java) +- Azure Java Client Runtime for ARM (from https://github.com/Azure/autorest-clientruntime-for-java) - Azure Java Client Runtime for AutoRest (from https://github.com/Azure/autorest-clientruntime-for-java) - Azure Metrics Spring Boot Starter (from https://github.com/Microsoft/azure-spring-boot) - Azure Spring Boot AutoConfigure (from https://github.com/Microsoft/azure-spring-boot) @@ -855,12 +927,15 @@ The following software have components provided under the terms of this license: - Bouncy Castle Provider (from http://www.bouncycastle.org/java.html) - Checker Qual (from https://checkerframework.org) - Checker Qual (from https://checkerframework.org) +- Elasticsearch: 5.0.0-alpha5 (from https://github.com/elastic/elasticsearch) - Extensions on Apache Proton-J library (from https://github.com/Azure/qpid-proton-j-extensions) - JOpt Simple (from http://pholser.github.io/jopt-simple) - JUL to SLF4J bridge (from http://www.slf4j.org) - Java Client Runtime for AutoRest (from https://github.com/Azure/autorest-clientruntime-for-java) - Java JWT (from http://www.jwt.io) - Lucene Core (from ) +- Lucene Core (from ) +- Lucene Sandbox (from ) - Microsoft Application Insights Java SDK Core (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java) @@ -868,17 +943,20 @@ The following software have components provided under the terms of this license: - Microsoft Azure Java Core Library (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure Netty HTTP Client Library (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure SDK annotations (from https://github.com/Microsoft/java-api-annotations) +- Microsoft Azure SDK for EventGrid Management (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure SDK for SQL API of Azure Cosmos DB Service (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure SDK for Service Bus (from https://github.com/Azure/azure-sdk-for-java) +- Microsoft Azure SDK for eventgrid (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure client library for Blob Storage (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure client library for Identity (from https://github.com/Azure/azure-sdk-for-java) +- Microsoft Azure client library for KeyVault Keys (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure client library for KeyVault Secrets (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure common module for Storage (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure internal Avro module for Storage (from https://github.com/Azure/azure-sdk-for-java) -- Mockito (from http://www.mockito.org) - Mockito (from http://mockito.org) - Mockito (from http://mockito.org) - Mockito (from http://mockito.org) +- Mockito (from http://www.mockito.org) - Netty/Codec/HTTP (from ) - Netty/Common (from ) - Plexus :: Default Container (from ) @@ -888,6 +966,8 @@ The following software have components provided under the terms of this license: - Spongy Castle (from http://rtyley.github.io/spongycastle/) - Spring Data for Azure Cosmos DB SQL API (from https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-spring-data-cosmos) - adal4j (from https://github.com/AzureAD/azure-activedirectory-library-for-java) +- azure-documentdb (from https://azure.microsoft.com/en-us/services/cosmos-db/) +- documentdb-bulkexecutor (from http://azure.microsoft.com/en-us/services/documentdb/) - micrometer-core (from https://github.com/micrometer-metrics/micrometer) - msal4j (from https://github.com/AzureAD/microsoft-authentication-library-for-java) - msal4j-persistence-extension (from https://github.com/AzureAD/microsoft-authentication-extensions-for-java) @@ -901,6 +981,7 @@ The following software have components provided under the terms of this license: - Cobertura code coverage (from http://cobertura.sourceforge.net) - Javassist (from http://www.javassist.org/) - Javassist (from http://www.javassist.org/) +- RabbitMQ Java Client (from http://www.rabbitmq.com) ======================================================================== MPL-2.0 @@ -909,6 +990,7 @@ The following software have components provided under the terms of this license: - Javassist (from http://www.javassist.org/) - Javassist (from http://www.javassist.org/) +- RabbitMQ Java Client (from http://www.rabbitmq.com) ======================================================================== PHP-3.01 @@ -982,13 +1064,16 @@ The following software have components provided under the terms of this license: - Joda-Time (from http://www.joda.org/joda-time/) - LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - Microsoft Application Insights Java SDK Core (from https://github.com/Microsoft/ApplicationInsights-Java) +- Microsoft Azure SDK for EventGrid Management (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure SDK for SQL API of Azure Cosmos DB Service (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure client library for Blob Storage (from https://github.com/Azure/azure-sdk-for-java) - Project Lombok (from https://projectlombok.org) +- RabbitMQ Java Client (from http://www.rabbitmq.com) - Spring Security JWT Library (from http://github.com/spring-projects/spring-security-oauth) - Spring Security JWT Library (from http://github.com/spring-projects/spring-security-oauth) - Spring Web (from https://github.com/spring-projects/spring-framework) - StAX API (from http://stax.codehaus.org/) +- azure-documentdb (from https://azure.microsoft.com/en-us/services/cosmos-db/) - msal4j (from https://github.com/AzureAD/microsoft-authentication-library-for-java) - reactive-streams (from http://www.reactive-streams.org/) - xml-apis (from ) @@ -1005,6 +1090,7 @@ The following software have components provided under the terms of this license: - Byte Buddy (without dependencies) (from ) - JUnit (from http://junit.org) - JavaBeans Activation Framework API jar (from ) +- RabbitMQ Java Client (from http://www.rabbitmq.com) - Servlet Specification 2.5 API (from ) - Spongy Castle (from http://rtyley.github.io/spongycastle/) - System Rules (from http://stefanbirkner.github.io/system-rules/) diff --git a/devops/azure/chart/templates/deployment.yaml b/devops/azure/chart/templates/deployment.yaml index 1f8e620484e28c856b2ddad65a3ef0d1bf202156..20fac08cff7a776c18f4daacf8b23b4815b3ef90 100644 --- a/devops/azure/chart/templates/deployment.yaml +++ b/devops/azure/chart/templates/deployment.yaml @@ -87,8 +87,10 @@ spec: value: osdu-db - name: servicebus_topic_name value: indexing-progress + - name: reindex_topic_name + value: recordstopic - name: entitlements_service_endpoint - value: http://entitlements-azure/entitlements/v1 + value: http://entitlements/api/entitlements/v2 - name: entitlements_service_api_key value: "OBSOLETE" - name: schema_service_url diff --git a/docs/tutorial/IndexerService.md b/docs/tutorial/IndexerService.md index d11f167561fe101c5aa81affb1d7a0eae0b2496a..0873557d9b48c398bdb17e8aeae3b6a6426f1f38 100644 --- a/docs/tutorial/IndexerService.md +++ b/docs/tutorial/IndexerService.md @@ -8,6 +8,7 @@ - [Copy Index <a name="copy-index"></a>](#copy-index) - [Get task status <a name="get-task-status"></a>](#get-task-status) - [Schema Service adoption <a name="schema-service-adoption"></a>](#schema-service-adoption) + - [R3 Schema Support <a name="r3-schema-support"></a>](#r3-schema-support) ##Introduction <a name="introduction"></a> @@ -251,7 +252,7 @@ API will respond with status of task. [Back to table of contents](#TOC) -##Shema Service adoption <a name="schema-service-adoption"></a> +##Schema Service adoption <a name="schema-service-adoption"></a> Indexer service is in adaptation process to use schemas from the Schema service instead of Storage Service. The Indexer Service retrieves a schema from the Schema Service if the schema is not found on the Storage Service. @@ -260,3 +261,38 @@ Later call to the Storage Service will be deprecated and then removed (after the [Back to table of contents](#TOC) +###R3 Schema Support <a name="r3-schema-support"></a> + +Indexer service support r3 schema. These schemas are created via Schema service. + +Here is an example following end-to-end workflow can be exercised (please update the schema based on your environment): + +* Ingest r3 schema for `opendes:wks:master-data--Wellbore:1.0.0`. Schema service payload can be found [here](https://community.opengroup.org/osdu/platform/system/indexer-service/-/blob/master/testing/indexer-test-core/src/main/resources/testData/r3-index_record_wks_master.schema.json). + +* Ingest r3 master-data Wellbore record. Storage service payload can be found [here](https://community.opengroup.org/osdu/platform/system/indexer-service/-/blob/master/testing/indexer-test-core/src/main/resources/testData/r3-index_record_wks_master.json) + +* Records can be searched via Search service. Here is sample payload: + +``` +POST /api/search/v2/query HTTP/1.1 +Content-Type: application/json +data-partition-id: opendes +{ + "kind": "opendes:wks:master-data--Wellbore:1.0.0", + "spatialFilter": { + "field": "data.SpatialLocation.Wgs84Coordinates", + "byBoundingBox": { + "topLeft": { + "longitude": -100.0, + "latitude": 52.0 + }, + "bottomRight": { + "longitude": 100.0, + "latitude": 0.0 + } + } + } +} +``` +[Back to table of contents](#TOC) + diff --git a/indexer-core/pom.xml b/indexer-core/pom.xml index 919ad21103a071122b569c0ca33c2215a6ecaff6..49ce44c6ad55653079bcfe146f6561f7b9f5f5f7 100644 --- a/indexer-core/pom.xml +++ b/indexer-core/pom.xml @@ -4,18 +4,19 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <artifactId>indexer-core</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <name>indexer-core</name> <description>Indexer Service Core</description> <packaging>jar</packaging> <properties> <commons-beanutils.version>1.9.4</commons-beanutils.version> + <osdu.oscorecommon.version>0.6.9</osdu.oscorecommon.version> </properties> <dependencies> @@ -33,6 +34,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>os-core-common</artifactId> + <version>${osdu.oscorecommon.version}</version> </dependency> <!-- spring boot dependencies --> diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Feature.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Feature.java new file mode 100644 index 0000000000000000000000000000000000000000..4d03bbe093b622e8fb08fd4659623fcb194feb0a --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Feature.java @@ -0,0 +1,40 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +@Data +public class Feature extends GeoJsonObject { + + @JsonInclude() + private Map<String, Object> properties = new HashMap<>(); + @JsonInclude() + private GeoJsonObject geometry; + private String id; + + public void setProperty(String key, Object value) { + properties.put(key, value); + } + + @SuppressWarnings("unchecked") + public <T> T getProperty(String key) { + return (T) properties.get(key); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/FeatureCollection.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/FeatureCollection.java new file mode 100644 index 0000000000000000000000000000000000000000..2040e646469ad32cd0dd036f732657f85da7a092 --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/FeatureCollection.java @@ -0,0 +1,45 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import lombok.Data; +import org.opengroup.osdu.indexer.model.geojson.jackson.FeatureCollectionSerializer; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +@Data +@JsonSerialize(using = FeatureCollectionSerializer.class) +public class FeatureCollection extends GeoJsonObject implements Iterable<Feature> { + + private List<Feature> features = new ArrayList<Feature>(); + + public FeatureCollection add(Feature feature) { + features.add(feature); + return this; + } + + public void addAll(Collection<Feature> features) { + this.features.addAll(features); + } + + @Override + public Iterator<Feature> iterator() { + return features.iterator(); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/GeoJsonObject.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/GeoJsonObject.java new file mode 100644 index 0000000000000000000000000000000000000000..2f137a5fbb232400f51bb55ef5de4e40d3fd4909 --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/GeoJsonObject.java @@ -0,0 +1,36 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; +import lombok.Data; + +@Data +@JsonTypeInfo(property = "type", use = Id.NAME) +@JsonSubTypes({ @Type(Feature.class), @Type(Polygon.class), @Type(MultiPolygon.class), @Type(FeatureCollection.class), + @Type(Point.class), @Type(MultiPoint.class), @Type(MultiLineString.class), @Type(LineString.class), + @Type(GeometryCollection.class) }) +@JsonInclude(Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public abstract class GeoJsonObject implements Serializable { +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Geometry.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Geometry.java new file mode 100644 index 0000000000000000000000000000000000000000..99b0841ac5e9d1319ef7cca9ecd79ceb6928988b --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Geometry.java @@ -0,0 +1,45 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import java.util.ArrayList; +import java.util.List; + +public abstract class Geometry<T> extends GeoJsonObject { + + protected List<T> coordinates = new ArrayList<T>(); + + public Geometry() { + } + + public Geometry(T... elements) { + for (T coordinate : elements) { + coordinates.add(coordinate); + } + } + + public Geometry<T> add(T elements) { + coordinates.add(elements); + return this; + } + + public List<T> getCoordinates() { + return coordinates; + } + + public void setCoordinates(List<T> coordinates) { + this.coordinates = coordinates; + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/GeometryCollection.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/GeometryCollection.java new file mode 100644 index 0000000000000000000000000000000000000000..903ac08186b4dc12eb02b0e4792e5f43c3a934df --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/GeometryCollection.java @@ -0,0 +1,37 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +@Data +public class GeometryCollection extends GeoJsonObject implements Iterable<GeoJsonObject> { + + private List<GeoJsonObject> geometries = new ArrayList<GeoJsonObject>(); + + @Override + public Iterator<GeoJsonObject> iterator() { + return geometries.iterator(); + } + + public GeometryCollection add(GeoJsonObject geometry) { + geometries.add(geometry); + return this; + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/LineString.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/LineString.java new file mode 100644 index 0000000000000000000000000000000000000000..8eee047745dd486fc91ac4287b491525e9572c5e --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/LineString.java @@ -0,0 +1,25 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import lombok.NoArgsConstructor; + +@NoArgsConstructor +public class LineString extends MultiPoint { + + public LineString(Position... points) { + super(points); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/MultiLineString.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/MultiLineString.java new file mode 100644 index 0000000000000000000000000000000000000000..2e16db6e8ac5d06565cd9af8ccfa2e91da1faca6 --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/MultiLineString.java @@ -0,0 +1,27 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import lombok.NoArgsConstructor; + +import java.util.List; + +@NoArgsConstructor +public class MultiLineString extends Geometry<List<Position>> { + + public MultiLineString(List<Position> line) { + add(line); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/MultiPoint.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/MultiPoint.java new file mode 100644 index 0000000000000000000000000000000000000000..aabbdda84f31e9c4b30c986e6c5b4ae805788c05 --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/MultiPoint.java @@ -0,0 +1,25 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import lombok.NoArgsConstructor; + +@NoArgsConstructor +public class MultiPoint extends Geometry<Position> { + + public MultiPoint(Position... points) { + super(points); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/MultiPolygon.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/MultiPolygon.java new file mode 100644 index 0000000000000000000000000000000000000000..6c9d8af0cd6b7f43d7b0a1b0ff5b7a106856b210 --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/MultiPolygon.java @@ -0,0 +1,32 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import lombok.NoArgsConstructor; + +import java.util.List; + +@NoArgsConstructor +public class MultiPolygon extends Geometry<List<List<Position>>> { + + public MultiPolygon(Polygon polygon) { + add(polygon); + } + + public MultiPolygon add(Polygon polygon) { + coordinates.add(polygon.getCoordinates()); + return this; + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Point.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Point.java new file mode 100644 index 0000000000000000000000000000000000000000..9808209aa43e9eec7dd1c974dc5772aa9e7676a3 --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Point.java @@ -0,0 +1,35 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class Point extends GeoJsonObject { + + private Position coordinates; + + public Point(double longitude, double latitude) { + coordinates = new Position(longitude, latitude); + } + + public Point(double longitude, double latitude, double altitude) { + coordinates = new Position(longitude, latitude, altitude); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Polygon.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Polygon.java new file mode 100644 index 0000000000000000000000000000000000000000..31461b421204d45bb9c00dbabd42922a8e9f0c43 --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Polygon.java @@ -0,0 +1,73 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.NoArgsConstructor; + +import java.util.Arrays; +import java.util.List; + +@NoArgsConstructor +public class Polygon extends Geometry<List<Position>> { + + public Polygon(List<Position> polygon) { + add(polygon); + } + + public Polygon(Position... polygon) { + add(Arrays.asList(polygon)); + } + + public void setExteriorRing(List<Position> points) { + if (coordinates.isEmpty()) { + coordinates.add(0, points); + } else { + coordinates.set(0, points); + } + } + + @JsonIgnore + public List<Position> getExteriorRing() { + assertExteriorRing(); + return coordinates.get(0); + } + + @JsonIgnore + public List<List<Position>> getInteriorRings() { + assertExteriorRing(); + return coordinates.subList(1, coordinates.size()); + } + + public List<Position> getInteriorRing(int index) { + assertExteriorRing(); + return coordinates.get(1 + index); + } + + public void addInteriorRing(List<Position> points) { + assertExteriorRing(); + coordinates.add(points); + } + + public void addInteriorRing(Position... points) { + assertExteriorRing(); + coordinates.add(Arrays.asList(points)); + } + + private void assertExteriorRing() { + if (coordinates.isEmpty()) + throw new RuntimeException("No exterior ring defined"); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Position.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Position.java new file mode 100644 index 0000000000000000000000000000000000000000..fa124ee189a132ee0056dc05e8a2ce1bd970adfd --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/Position.java @@ -0,0 +1,70 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.opengroup.osdu.indexer.model.geojson.jackson.PositionDeserializer; +import org.opengroup.osdu.indexer.model.geojson.jackson.PositionSerializer; + +import java.io.Serializable; + +@Getter +@NoArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +@AllArgsConstructor +@JsonDeserialize(using = PositionDeserializer.class) +@JsonSerialize(using = PositionSerializer.class) +public class Position implements Serializable { + + private double longitude; + private double latitude; + @JsonIgnore + private double altitude = Double.NaN; + + public Position(double longitude, double latitude) { + this.setLongitude(longitude); + this.setLatitude(latitude); + } + + public void setLongitude(double longitude) { + if (Double.isNaN(longitude)) + throw new IllegalArgumentException("latitude must be number"); + if (longitude > 180 || longitude < -180) + throw new IllegalArgumentException("'longitude' value is out of the range [-180, 180]"); + this.longitude = longitude; + } + + public void setLatitude(double latitude) { + if (Double.isNaN(latitude)) + throw new IllegalArgumentException("latitude must be number"); + if (latitude > 90 || latitude < -90) + throw new IllegalArgumentException("latitude value is out of the range [-90, 90]"); + this.latitude = latitude; + } + + public void setAltitude(double altitude) { + this.altitude = altitude; + } + + public boolean hasAltitude() { + return !Double.isNaN(altitude); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/jackson/FeatureCollectionSerializer.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/jackson/FeatureCollectionSerializer.java new file mode 100644 index 0000000000000000000000000000000000000000..f5d412a042655bcabed7e0840c61e5f4d8785d7c --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/jackson/FeatureCollectionSerializer.java @@ -0,0 +1,81 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson.jackson; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.jsontype.TypeSerializer; +import lombok.Data; +import org.opengroup.osdu.indexer.model.geojson.*; + +import java.io.IOException; + +@Data +public class FeatureCollectionSerializer extends JsonSerializer<FeatureCollection> { + + @Override + public void serialize(FeatureCollection value, JsonGenerator jsonGenerator, SerializerProvider provider) throws IOException { + jsonGenerator.writeStartObject(); + jsonGenerator.writeStringField("type", "geometrycollection"); + + jsonGenerator.writeArrayFieldStart("geometries"); + for (Feature feature : value.getFeatures()) { + jsonGenerator.writeStartObject(); + if (feature.getGeometry() instanceof GeometryCollection) { + GeometryCollection geometryCollection = (GeometryCollection) feature.getGeometry(); + for (GeoJsonObject shape : geometryCollection.getGeometries()) { + serializeGeoShape(shape, jsonGenerator); + } + } else { + serializeGeoShape(feature.getGeometry(), jsonGenerator); + } + jsonGenerator.writeEndObject(); + } + jsonGenerator.writeEndArray(); + + jsonGenerator.writeEndObject(); + } + + @Override + public void serializeWithType(FeatureCollection value, JsonGenerator jsonGenerator, SerializerProvider provider, TypeSerializer typeSerializer) + throws IOException, JsonProcessingException { + + serialize(value, jsonGenerator, provider); + } + + private void serializeGeoShape(GeoJsonObject geoJsonObject, JsonGenerator jsonGenerator) throws IOException { + if (geoJsonObject instanceof Point) { + jsonGenerator.writeStringField("type", "point"); + jsonGenerator.writeObjectField("coordinates", ((Point) geoJsonObject).getCoordinates()); + } else if (geoJsonObject instanceof LineString) { + jsonGenerator.writeStringField("type", "linestring"); + jsonGenerator.writeObjectField("coordinates", ((LineString) geoJsonObject).getCoordinates()); + } else if (geoJsonObject instanceof Polygon) { + jsonGenerator.writeStringField("type", "polygon"); + jsonGenerator.writeObjectField("coordinates", ((Polygon) geoJsonObject).getCoordinates()); + } else if (geoJsonObject instanceof MultiPoint) { + jsonGenerator.writeStringField("type", "multipoint"); + jsonGenerator.writeObjectField("coordinates", ((MultiPoint) geoJsonObject).getCoordinates()); + } else if (geoJsonObject instanceof MultiLineString) { + jsonGenerator.writeStringField("type", "multilinestring"); + jsonGenerator.writeObjectField("coordinates", ((MultiLineString) geoJsonObject).getCoordinates()); + } else if (geoJsonObject instanceof MultiPolygon) { + jsonGenerator.writeStringField("type", "multipolygon"); + jsonGenerator.writeObjectField("coordinates", ((MultiPolygon) geoJsonObject).getCoordinates()); + } + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/jackson/PositionDeserializer.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/jackson/PositionDeserializer.java new file mode 100644 index 0000000000000000000000000000000000000000..5c721c2e3a3042956f4b46972e85a07620d3ba76 --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/jackson/PositionDeserializer.java @@ -0,0 +1,67 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson.jackson; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import org.opengroup.osdu.indexer.model.geojson.Position; + +import java.io.IOException; + +public class PositionDeserializer extends JsonDeserializer<Position> { + + @Override + public Position deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException { + if (jsonParser.isExpectedStartArrayToken()) { + return deserializeArray(jsonParser, context); + } + throw context.mappingException(Position.class); + } + + protected Position deserializeArray(JsonParser jsonParser, DeserializationContext context) throws IOException { + Position node = new Position(); + node.setLongitude(extractDouble(jsonParser, context, false)); + node.setLatitude(extractDouble(jsonParser, context, false)); + node.setAltitude(extractDouble(jsonParser, context, true)); + return node; + } + + private double extractDouble(JsonParser jsonParser, DeserializationContext context, boolean optional) throws IOException { + JsonToken token = jsonParser.nextToken(); + if (token == null) { + if (optional) + return Double.NaN; + else + throw context.mappingException("Unexpected end-of-input when binding data into Position"); + } else { + switch (token) { + case END_ARRAY: + if (optional) + return Double.NaN; + else + throw context.mappingException("Unexpected end-of-input when binding data into Position"); + case VALUE_NUMBER_FLOAT: + return jsonParser.getDoubleValue(); + case VALUE_NUMBER_INT: + return jsonParser.getLongValue(); + default: + throw context.mappingException( + "Unexpected token (" + token.name() + ") when binding data into Position"); + } + } + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/jackson/PositionSerializer.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/jackson/PositionSerializer.java new file mode 100644 index 0000000000000000000000000000000000000000..09275a25866265a802665217c2718f15967c6379 --- /dev/null +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/model/geojson/jackson/PositionSerializer.java @@ -0,0 +1,36 @@ +// Copyright © Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.model.geojson.jackson; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import org.opengroup.osdu.indexer.model.geojson.Position; + +import java.io.IOException; + +public class PositionSerializer extends JsonSerializer<Position> { + + @Override + public void serialize(Position value, JsonGenerator jsonGenerator, SerializerProvider provider) throws IOException { + jsonGenerator.writeStartArray(); + jsonGenerator.writeNumber(value.getLongitude()); + jsonGenerator.writeNumber(value.getLatitude()); + if (value.hasAltitude()) { + jsonGenerator.writeNumber(value.getAltitude()); + } + jsonGenerator.writeEndArray(); + } +} diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/PropertiesProcessor.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/PropertiesProcessor.java index d98b1f77281138a9c3de3304350da461cda9ac08..57c2cae2c13e0e1b99dd963a1b7c650225fa5a10 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/PropertiesProcessor.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/PropertiesProcessor.java @@ -13,6 +13,7 @@ // limitations under the License. package org.opengroup.osdu.indexer.schema.converter; + import org.apache.http.HttpStatus; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.AppException; @@ -78,12 +79,16 @@ public class PropertiesProcessor { String definitionSubRef = ref.substring(DEF_PREFIX.length()); - if (schemaConverterConfig.getSkippedDefinitions().contains(definitionSubRef)) { + String definitionIdentity = getDefinitionIdentity(definitionSubRef); + + if (schemaConverterConfig.getSkippedDefinitions().contains(definitionIdentity)) { return Stream.empty(); } - if (Objects.nonNull(schemaConverterConfig.getSpecialDefinitionsMap().get(definitionSubRef))) { - return storageSchemaEntry(schemaConverterConfig.getSpecialDefinitionsMap().get(definitionSubRef), pathPrefix); + if (Objects.nonNull(schemaConverterConfig.getSpecialDefinitionsMap().get(definitionIdentity))) { + return storageSchemaEntry( + schemaConverterConfig.getSpecialDefinitionsMap().get(definitionIdentity) + getDefinitionColonVersion(definitionSubRef), + pathPrefix); } Definition definition = definitions.getDefinition(definitionSubRef); @@ -101,6 +106,26 @@ public class PropertiesProcessor { return processProperties(definition.getProperties()); } + private String getDefinitionIdentity(String definitionSubRef) { + String[] components = definitionSubRef.split(":"); + if (components.length < 4) { + throw new AppException(HttpStatus.SC_CONFLICT, "Wrong definition format:" + definitionSubRef, + "Wrong definition format:" + definitionSubRef); + } + + return components[2]; + } + + private String getDefinitionColonVersion(String definitionSubRef) { + String[] components = definitionSubRef.split(":"); + if (components.length < 4) { + throw new AppException(HttpStatus.SC_CONFLICT, "Wrong definition format:" + definitionSubRef, + "Wrong definition format:" + definitionSubRef); + } + + return ":" + components[3]; + } + private Stream<Map<String, Object>> processOfItems(List<AllOfItem> allOf, List<AllOfItem> anyOf, List<AllOfItem> oneOf) { Stream<Map<String, Object>> ofItems = null; @@ -119,7 +144,7 @@ public class PropertiesProcessor { return ofItems; } - public Stream<Map<String, Object>> processProperties(Map<String, TypeProperty> properties){ + public Stream<Map<String, Object>> processProperties(Map<String, TypeProperty> properties) { return properties.entrySet().stream().flatMap(this::processPropertyEntry); } @@ -175,7 +200,7 @@ public class PropertiesProcessor { PropertiesProcessor propertiesProcessor = new PropertiesProcessor(definitions, pathPrefixWithDot + entry.getKey() , log, new SchemaConverterPropertiesConfig()); - ofItems = Stream.concat(Optional.ofNullable(ofItems).orElseGet(Stream::empty), + ofItems = Stream.concat(Optional.ofNullable(ofItems).orElseGet(Stream::empty), entry.getValue().getAnyOf().stream().flatMap(propertiesProcessor::processItem)); } @@ -207,7 +232,7 @@ public class PropertiesProcessor { getFromPattern(definitionProperty.getPattern()), getFromItemsPattern(() -> definitionProperty.getItems() != null ? definitionProperty.getItems().getPattern() : null), getFromFormat(definitionProperty::getFormat), - getFromItemsType (() -> definitionProperty.getItems() != null ? definitionProperty.getItems().getType() : null)) + getFromItemsType(() -> definitionProperty.getItems() != null ? definitionProperty.getItems().getType() : null)) .filter(x -> x.get() != null) .findFirst() .orElse(getFromType(definitionProperty::getType)).get(); @@ -219,20 +244,20 @@ public class PropertiesProcessor { private Supplier<String> getFromItemsPattern(Supplier<String> itemsPatternSupplier) { return () -> { - String itemsPattern = itemsPatternSupplier.get(); - return Objects.nonNull(itemsPattern) && itemsPattern.startsWith(LINK_PREFIX) ? LINK_TYPE : null; - }; + String itemsPattern = itemsPatternSupplier.get(); + return Objects.nonNull(itemsPattern) && itemsPattern.startsWith(LINK_PREFIX) ? LINK_TYPE : null; + }; } private Supplier<String> getFromType(Supplier<String> typeSupplier) { - return () -> { + return () -> { String type = typeSupplier.get(); return schemaConverterConfig.getPrimitiveTypesMap().getOrDefault(type, type); }; } - private Supplier<String> getFromFormat(Supplier<String> formatSupplier){ - return () -> { + private Supplier<String> getFromFormat(Supplier<String> formatSupplier) { + return () -> { String format = formatSupplier.get(); return Objects.nonNull(format) ? schemaConverterConfig.getPrimitiveTypesMap().getOrDefault(format, format) : null; }; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/config/SchemaConverterPropertiesConfig.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/config/SchemaConverterPropertiesConfig.java index f530c842ba0bae004bc3e54e080cca143edb88c9..9e5eaff440b905d9bce2db41eff1f69f555e4469 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/config/SchemaConverterPropertiesConfig.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/config/SchemaConverterPropertiesConfig.java @@ -19,20 +19,20 @@ public class SchemaConverterPropertiesConfig implements SchemaConverterConfig { private Map<String, String> primitiveTypesMap = getDefaultPrimitiveTypesMap(); private Set<String> getDefaultSkippedDefinitions() { - return new HashSet<>(Arrays.asList("AbstractAnyCrsFeatureCollection.1.0.0", + return new HashSet<>(Arrays.asList("AbstractAnyCrsFeatureCollection", "anyCrsGeoJsonFeatureCollection")); } private Set<String> getDefaultSupportedArrayTypes() { - return new HashSet<>(Arrays.asList("boolean", "integer", "number", "string")); + return new HashSet<>(Arrays.asList("boolean", "integer", "number", "string", "object")); } private Map<String, String> getDefaultSpecialDefinitionsMap() { Map<String, String> defaultSpecialDefinitions = new HashMap<>(); - defaultSpecialDefinitions.put("AbstractFeatureCollection.1.0.0", "core:dl:geoshape:1.0.0"); - defaultSpecialDefinitions.put("core_dl_geopoint", "core:dl:geopoint:1.0.0"); - defaultSpecialDefinitions.put("geoJsonFeatureCollection", "core:dl:geoshape:1.0.0"); + defaultSpecialDefinitions.put("AbstractFeatureCollection", "core:dl:geoshape"); + defaultSpecialDefinitions.put("core_dl_geopoint", "core:dl:geopoint"); + defaultSpecialDefinitions.put("geoJsonFeatureCollection", "core:dl:geoshape"); return defaultSpecialDefinitions; } diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/readme.md b/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/readme.md index 3b5e146c5760cd3084651a612fae228d5a80c035..aafac004ecb70a82185b0b2f9ebd52e6071c23e5 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/readme.md +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/readme.md @@ -81,7 +81,7 @@ included "data": { "allOf": [ { - "$ref": "#/definitions/AbstractFacility.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractFacility.1.0.0" }, { "type": "object", @@ -109,7 +109,7 @@ For instance, ```json "elevationReference": { - "$ref": "#/definitions/simpleElevationReference", + "$ref": "#/definitions/opendes:wks:simpleElevationReference:1.0.0", "description": "…", "title": "Elevation Reference", "type": "object" @@ -119,7 +119,7 @@ For instance, "description": "...", "properties": { "elevationFromMsl": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "…", "example": 123.45, "title": "Elevation from MSL", @@ -157,10 +157,18 @@ Not all data are converted to the storage service schema format: 1. Definitions -Ignored definition(-s) are not included into Storage Service schema: +Definitions must follow the pattern a:b:name:version, where a,b,name are required and version is optional. +For instance + +```json +opendes:wks:AbstractAnyCrsFeatureCollection:1.0.0 +opendes:wks:anyJsonFeatureCollection +``` + +Ignored definition(-s) name(-s) are not included into Storage Service schema: ```json -AbstractAnyCrsFeatureCollection.1.0.0 +AbstractAnyCrsFeatureCollection anyCrsGeoJsonFeatureCollection ``` @@ -168,7 +176,7 @@ Following definitions are not unwrapped and kind is determined according to the following types conversions: ```json -AbstractFeatureCollection.1.0.0 -> core:dl:geoshape:1.0.0 +AbstractFeatureCollection:version -> core:dl:geoshape:version geoJsonFeatureCollection -> core:dl:geoshape:1.0.0 core_dl_geopoint -> core:dl:geopoint:1.0.0 ``` @@ -179,7 +187,7 @@ for instance "Wgs84Coordinates": { "title": "WGS 84 Coordinates", "description": "…", - "$ref": "#/definitions/AbstractFeatureCollection.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractFeatureCollection.1.0.0" } ``` @@ -261,7 +269,7 @@ Examples "description": "The history of operator organizations of the facility.", "type": "array", "items": { - "$ref": "#/definitions/AbstractFacilityOperator.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractFacilityOperator.1.0.0" } } @@ -310,14 +318,14 @@ For instance ```json { "definitions": { - "wellboreData1": { + "opendes:wks:wellboreData1:1.0.0": { "properties": { "prop1": { "type": "string" } } }, - "wellboreData2": { + "opendes:wks:wellboreData2:1.0.0": { "properties": { "prop2": { "type": "string" @@ -331,11 +339,11 @@ For instance { "anyOf": [ { - "$ref": "#/definitions/wellboreData1" + "$ref": "#/definitions/opendes:wks:wellboreData1:1.0.0" } ], "oneOf": [ { - "$ref": "#/definitions/wellboreData2" + "$ref": "#/definitions/opendes:wks:wellboreData2:1.0.0" } ] } diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImpl.java index fae0b4e6f31cd18ad960b841b6d9723e0162cf29..733408ab3257219f75899e1e57b6a491abad08d2 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImpl.java @@ -25,6 +25,7 @@ import org.opengroup.osdu.core.common.model.indexer.IndexSchema; import org.opengroup.osdu.core.common.model.indexer.IndexingStatus; import org.opengroup.osdu.core.common.model.indexer.JobStatus; import org.opengroup.osdu.core.common.Constants; +import org.opengroup.osdu.indexer.model.geojson.FeatureCollection; import org.opengroup.osdu.indexer.util.parser.BooleanParser; import org.opengroup.osdu.indexer.util.parser.DateTimeParser; import org.opengroup.osdu.indexer.util.parser.GeoShapeParser; @@ -185,7 +186,7 @@ public class AttributeParsingServiceImpl implements IAttributeParsingService { dataMap.put(DATA_GEOJSON_TAG, geometry); } } catch (JsonSyntaxException | IllegalArgumentException e) { - String parsingError = String.format("geopoint parsing error: %s attribute: %s | value: %s", e.getMessage(), attributeName, attributeVal); + String parsingError = String.format("geo-point parsing error: %s attribute: %s | value: %s", e.getMessage(), attributeName, attributeVal); jobStatus.addOrUpdateRecordStatus(recordId, IndexingStatus.WARN, HttpStatus.SC_BAD_REQUEST, parsingError, String.format("record-id: %s | %s", recordId, parsingError)); } } @@ -199,9 +200,9 @@ public class AttributeParsingServiceImpl implements IAttributeParsingService { if (geoJsonMap == null || geoJsonMap.isEmpty()) return; - this.geoShapeParser.parseGeoJson(geoJsonMap); + Map<String, Object> parsedShape = this.geoShapeParser.parseGeoJson(geoJsonMap); - dataMap.put(attributeName, geoJsonMap); + dataMap.put(attributeName, parsedShape); } catch (JsonSyntaxException | IllegalArgumentException e) { String parsingError = String.format("geo-json shape parsing error: %s attribute: %s", e.getMessage(), attributeName); jobStatus.addOrUpdateRecordStatus(recordId, IndexingStatus.WARN, HttpStatus.SC_BAD_REQUEST, parsingError, String.format("record-id: %s | %s", recordId, parsingError)); diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java index 1020c909825d7cf8372d9c935675d259104e8ed9..a63848140947c2a425c69458671733c3beaae684 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java @@ -226,6 +226,7 @@ public class IndexSchemaServiceImpl implements IndexSchemaService { meta.put(RecordMetaAttribute.TYPE.getValue(), TypeMapper.getIndexerType(RecordMetaAttribute.TYPE)); meta.put(RecordMetaAttribute.ACL.getValue(), TypeMapper.getIndexerType(RecordMetaAttribute.ACL)); meta.put(RecordMetaAttribute.X_ACL.getValue(), TypeMapper.getIndexerType(RecordMetaAttribute.X_ACL)); + meta.put(RecordMetaAttribute.TAGS.getValue(), TypeMapper.getIndexerType(RecordMetaAttribute.TAGS)); meta.put(RecordMetaAttribute.LEGAL.getValue(), TypeMapper.getIndexerType(RecordMetaAttribute.LEGAL)); meta.put(RecordMetaAttribute.ANCESTRY.getValue(), TypeMapper.getIndexerType(RecordMetaAttribute.ANCESTRY)); meta.put(RecordMetaAttribute.INDEX_STATUS.getValue(), TypeMapper.getIndexerType(RecordMetaAttribute.INDEX_STATUS)); diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java index 5fb8cba35b0886ce1e416f5e64f8d9952853ca9e..af1e5aea27f0b3846c68ba76a0514fa2ae714c22 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java @@ -48,6 +48,7 @@ import org.opengroup.osdu.indexer.util.ElasticClientHandler; import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver; import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.beanutils.NestedNullException; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import javax.inject.Inject; @@ -59,6 +60,7 @@ import java.util.logging.Level; import java.util.stream.Collectors; @Service +@Primary public class IndexerServiceImpl implements IndexerService { private static final TimeValue BULK_REQUEST_TIMEOUT = TimeValue.timeValueMinutes(1); @@ -309,6 +311,9 @@ public class IndexerServiceImpl implements IndexerService { document.setVersion(storageRecord.getVersion()); document.setAcl(storageRecord.getAcl()); document.setLegal(storageRecord.getLegal()); + if (storageRecord.getTags() != null) { + document.setTags(storageRecord.getTags()); + } RecordStatus recordStatus = this.jobStatus.getJobStatusByRecordId(storageRecord.getId()); if (recordStatus.getIndexProgress().getStatusCode() == 0) { recordStatus.getIndexProgress().setStatusCode(HttpStatus.SC_OK); @@ -463,6 +468,7 @@ public class IndexerServiceImpl implements IndexerService { indexerPayload.put(RecordMetaAttribute.TYPE.getValue(), record.getType()); indexerPayload.put(RecordMetaAttribute.VERSION.getValue(), record.getVersion()); indexerPayload.put(RecordMetaAttribute.ACL.getValue(), record.getAcl()); + indexerPayload.put(RecordMetaAttribute.TAGS.getValue(), record.getTags()); indexerPayload.put(RecordMetaAttribute.X_ACL.getValue(), Acl.flattenAcl(record.getAcl())); indexerPayload.put(RecordMetaAttribute.LEGAL.getValue(), record.getLegal()); indexerPayload.put(RecordMetaAttribute.INDEX_STATUS.getValue(), record.getIndexProgress()); diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/TypeMapper.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/TypeMapper.java index 521955ca066c450104ea8733e2ddd786414510a1..416728dc3cb6689e4486e41798f37d74b7e7e627 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/TypeMapper.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/TypeMapper.java @@ -43,6 +43,7 @@ public class TypeMapper { metaAttributeIndexerType.put(RecordMetaAttribute.VERSION.getValue(), ElasticType.LONG.getValue()); metaAttributeIndexerType.put(RecordMetaAttribute.X_ACL.getValue(), ElasticType.KEYWORD.getValue()); metaAttributeIndexerType.put(RecordMetaAttribute.ACL.getValue(), getAclIndexerMapping()); + metaAttributeIndexerType.put(RecordMetaAttribute.TAGS.getValue(), ElasticType.OBJECT.getValue()); metaAttributeIndexerType.put(RecordMetaAttribute.LEGAL.getValue(), getLegalIndexerMapping()); metaAttributeIndexerType.put(RecordMetaAttribute.ANCESTRY.getValue(), getAncestryIndexerMapping()); metaAttributeIndexerType.put(RecordMetaAttribute.INDEX_STATUS.getValue(), getIndexStatusMapping()); diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/parser/GeoShapeParser.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/parser/GeoShapeParser.java index 9532e498b0e1fee048c163f34baa953d702e6ace..8bd6ec834dd72dc399c9ea7b65a4772a771d959c 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/parser/GeoShapeParser.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/parser/GeoShapeParser.java @@ -14,55 +14,36 @@ package org.opengroup.osdu.indexer.util.parser; -import org.elasticsearch.ElasticsearchParseException; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.geo.builders.ShapeBuilder; -import org.elasticsearch.common.geo.parsers.ShapeParser; -import org.elasticsearch.common.xcontent.DeprecationHandler; -import org.elasticsearch.common.xcontent.NamedXContentRegistry; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.locationtech.spatial4j.exception.InvalidShapeException; -import org.locationtech.spatial4j.shape.Shape; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.exc.InvalidTypeIdException; import org.opengroup.osdu.core.common.search.Preconditions; +import org.opengroup.osdu.indexer.model.geojson.FeatureCollection; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; -import java.io.IOException; import java.util.Map; @Component @RequestScope public class GeoShapeParser { - public String parseGeoJson(Map<String, Object> geoShapeObject) { + private ObjectMapper mapper = new ObjectMapper(); - Preconditions.checkNotNull(geoShapeObject, "geoShapeObject cannot be null"); + public Map<String, Object> parseGeoJson(Map<String, Object> objectMap) { - try { - // use elasticsearch's ShapeParser to validate shape - ShapeBuilder shapeBuilder = getShapeBuilderFromObject(geoShapeObject); - Shape shape = shapeBuilder.buildS4J(); - if (shape == null) { - throw new IllegalArgumentException("unable to parse shape"); - } + Preconditions.checkNotNull(objectMap, "geoShapeObject cannot be null"); + if (objectMap.isEmpty()) throw new IllegalArgumentException("shape not included"); - return shapeBuilder.toString().replaceAll("\\r", "").replaceAll("\\n", ""); - } catch (ElasticsearchParseException | InvalidShapeException | IOException e) { - throw new IllegalArgumentException(e.getMessage(), e); + try { + FeatureCollection collection = mapper.readValue(mapper.writeValueAsString(objectMap), FeatureCollection.class); + return mapper.readValue(mapper.writeValueAsString(collection), new TypeReference<Map<String, Object>>() { + }); + } catch (InvalidTypeIdException e) { + throw new IllegalArgumentException("must be a valid FeatureCollection"); + } catch (JsonProcessingException e) { + throw new IllegalArgumentException("unable to parse FeatureCollection"); } } - - private ShapeBuilder getShapeBuilderFromObject(Map<String, Object> object) throws IOException { - XContentBuilder contentBuilder = JsonXContent.contentBuilder().value(object); - - XContentParser parser = JsonXContent.jsonXContent.createParser( - NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, - BytesReference.bytes(contentBuilder).streamInput() - ); - - parser.nextToken(); - return ShapeParser.parse(parser); - } } \ No newline at end of file diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/schema/converter/PropertiesProcessorTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/schema/converter/PropertiesProcessorTest.java index 600af3b43e448a1ac1c9603cf4007a546e333e4c..182bc58d33e4a1f1c491b805c6d1c1fe1dca9eed 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/schema/converter/PropertiesProcessorTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/schema/converter/PropertiesProcessorTest.java @@ -48,7 +48,7 @@ public class PropertiesProcessorTest { JaxRsDpsLog log = Mockito.mock(JaxRsDpsLog.class); assertFalse(new PropertiesProcessor(null, log, new SchemaConverterPropertiesConfig()) - .processRef(DEFINITIONS_PREFIX + "anyCrsGeoJsonFeatureCollection").findAny().isPresent()); + .processRef(DEFINITIONS_PREFIX + "a:b:anyCrsGeoJsonFeatureCollection:1.0.0").findAny().isPresent()); } @Test @@ -56,7 +56,7 @@ public class PropertiesProcessorTest { JaxRsDpsLog log = Mockito.mock(JaxRsDpsLog.class); String res = new PropertiesProcessor(null, PATH, log, new SchemaConverterPropertiesConfig()) - .processRef(DEFINITIONS_PREFIX + "core_dl_geopoint").map(Object::toString).reduce("", String::concat); + .processRef(DEFINITIONS_PREFIX + "a:b:core_dl_geopoint:1.0.0").map(Object::toString).reduce("", String::concat); assertEquals("{path=" + PATH + ", kind=core:dl:geopoint:1.0.0}", res); } @@ -76,7 +76,7 @@ public class PropertiesProcessorTest { definition.setProperties(properties); - String defName = "defName"; + String defName = "a:b:defName:1.0.0"; definitions.add(defName, definition); String res = new PropertiesProcessor(definitions, PATH, log, new SchemaConverterPropertiesConfig()) diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/schema/converter/SchemaToStorageFormatImplTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/schema/converter/SchemaToStorageFormatImplTest.java index 07642442dc178ce37cf934fdfbdbf7a0d044171e..e9ad441db9e9dd44c18ec2b5b99b5c3791db5461 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/schema/converter/SchemaToStorageFormatImplTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/schema/converter/SchemaToStorageFormatImplTest.java @@ -49,6 +49,11 @@ public class SchemaToStorageFormatImplTest { = new SchemaToStorageFormatImpl(objectMapper, jaxRsDpsLog , new SchemaConverterPropertiesConfig()); + @Test + public void dotsDefinitionFormat() { + testSingleFile("/converter/new-definitions-format/colons-sample.json", "osdu:osdu:Wellbore:1.0.0"); + } + @Test public void firstSchemaPassed() { testSingleFile("/converter/basic/schema.json", "osdu:osdu:Wellbore:1.0.0"); diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImplTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImplTest.java index 5db76eb05d6eaffa535320fe4603b83191e40d26..67362f02c6c74f2768e825a0f8063d4d9409ee4d 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImplTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImplTest.java @@ -321,7 +321,7 @@ public class AttributeParsingServiceImplTest { Map<String, Object> storageData = new HashMap<>(); storageData.put("location", parseJson(shapeJson)); - when(this.geoShapeParser.parseGeoJson(storageData)).thenReturn(""); + when(this.geoShapeParser.parseGeoJson(storageData)).thenReturn(new HashMap<>()); Map<String, Object> dataMap = new HashMap<>(); diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/impl/SchemaProviderImplTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/impl/SchemaProviderImplTest.java index 01aacce1ce07136503a3726055ae798e76ffc9c7..142c5de89fc2783a31fac2595fe9432ee2c26961 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/impl/SchemaProviderImplTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/service/impl/SchemaProviderImplTest.java @@ -77,7 +77,7 @@ public class SchemaProviderImplTest { Assert.assertEquals("{\n" + " \"kind\" : \"fake\",\n" + " \"schema\" : [ ]\n" + - "}", schema); + "}", schema.replaceAll("\r", "")); } diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/util/parser/GeoShapeParserTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/util/parser/GeoShapeParserTest.java index 8c1d36fe9b88461af9c8c16e4b2b83d2246c47b4..2e34f70c96326430f91e867ef4894cf9d9e90bfb 100644 --- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/util/parser/GeoShapeParserTest.java +++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/util/parser/GeoShapeParserTest.java @@ -29,8 +29,7 @@ import java.util.Map; import java.util.function.Function; import static org.hamcrest.CoreMatchers.containsString; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; +import static org.junit.Assert.*; @RunWith(SpringRunner.class) public class GeoShapeParserTest { @@ -45,124 +44,129 @@ public class GeoShapeParserTest { public void should_throwException_provided_emptyGeoJson() { String shapeJson = "{}"; - this.validateInput(this.sut::parseGeoJson, shapeJson, "shape type not included"); + this.validateInput(this.sut::parseGeoJson, shapeJson, "shape not included"); } @Test public void should_throwException_parseInvalidPoint() { - String shapeJson = "{\"type\":\"Point\",\"coordinates\":[-205.01621,39.57422]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-205.01621,39.57422]}}]}"; - this.validateInput(this.sut::parseGeoJson, shapeJson, "Bad X value -205.01621 is not in boundary Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)"); + this.validateInput(this.sut::parseGeoJson, shapeJson, "unable to parse FeatureCollection"); } @Test public void should_throwException_parseInvalidPoint_NaN() { - String shapeJson = "{\"type\":\"Point\",\"coordinates\":[-205.01621,NaN]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-205.01621,NaN]}}]}"; - this.validateInput(this.sut::parseGeoJson, shapeJson, "geo coordinates must be numbers"); + this.validateInput(this.sut::parseGeoJson, shapeJson, "unable to parse FeatureCollection"); } @Test public void should_throwException_parseInvalidPoint_missingLatitude() { - String shapeJson = "{\"type\":\"Point\",\"coordinates\":[-205.01621,\"\"]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-105.01621]}}]}"; - this.validateInput(this.sut::parseGeoJson, shapeJson, "geo coordinates must be numbers"); + this.validateInput(this.sut::parseGeoJson, shapeJson, "unable to parse FeatureCollection"); } @Test public void should_throwException_missingMandatoryAttribute() { - String shapeJson = "{\"mistype\":\"Point\",\"coordinates\":[-205.01621,39.57422]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"mistype\":\"Point\",\"coordinates\":[-205.01621,39.57422]}}]}"; - this.validateInput(this.sut::parseGeoJson, shapeJson, "shape type not included"); + this.validateInput(this.sut::parseGeoJson, shapeJson, "must be a valid FeatureCollection"); } @Test public void should_throwException_parseInvalidShape() { - String shapeJson = "{\"type\":\"InvalidShape\",\"coordinates\":[-105.01621,39.57422]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"InvalidShape\",\"coordinates\":[-105.01621,39.57422]}}]}"; - this.validateInput(this.sut::parseGeoJson, shapeJson, "unknown geo_shape [InvalidShape]"); + this.validateInput(this.sut::parseGeoJson, shapeJson, "must be a valid FeatureCollection"); } @Test public void should_parseValidPoint() { - String shapeJson = "{\"type\":\"Point\",\"coordinates\":[-105.01621,39.57422]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-105.01621,39.57422]}}]}"; this.validateInput(this.sut::parseGeoJson, shapeJson, Strings.EMPTY); } @Test public void should_parseValidMultiPoint() { - String shapeJson = "{\"type\":\"MultiPoint\",\"coordinates\":[[-105.01621,39.57422],[-80.666513,35.053994]]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiPoint\",\"coordinates\":[[-105.01621,39.57422],[-80.666513,35.053994]]}}]}"; this.validateInput(this.sut::parseGeoJson, shapeJson, Strings.EMPTY); } @Test public void should_parseValidLineString() { - String shapeJson = "{\"type\":\"LineString\",\"coordinates\":[[-101.744384,39.32155],[-101.552124,39.330048],[-101.403808,39.330048],[-101.332397,39.364032],[-101.041259,39.368279],[-100.975341,39.304549],[-100.914916,39.245016],[-100.843505,39.164141],[-100.805053,39.104488],[-100.491943,39.100226],[-100.437011,39.095962],[-100.338134,39.095962],[-100.195312,39.027718],[-100.008544,39.010647],[-99.865722,39.00211],[-99.684448,38.972221],[-99.51416,38.929502],[-99.382324,38.920955],[-99.321899,38.895308],[-99.113159,38.869651],[-99.0802,38.85682],[-98.822021,38.85682],[-98.448486,38.848264],[-98.206787,38.848264],[-98.020019,38.878204],[-97.635498,38.873928]]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[-101.744384,39.32155],[-101.552124,39.330048],[-101.403808,39.330048],[-101.332397,39.364032],[-101.041259,39.368279],[-100.975341,39.304549],[-100.914916,39.245016],[-100.843505,39.164141],[-100.805053,39.104488],[-100.491943,39.100226],[-100.437011,39.095962],[-100.338134,39.095962],[-100.195312,39.027718],[-100.008544,39.010647],[-99.865722,39.00211],[-99.684448,38.972221],[-99.51416,38.929502],[-99.382324,38.920955],[-99.321899,38.895308],[-99.113159,38.869651],[-99.0802,38.85682],[-98.822021,38.85682],[-98.448486,38.848264],[-98.206787,38.848264],[-98.020019,38.878204],[-97.635498,38.873928]]}}]}"; this.validateInput(this.sut::parseGeoJson, shapeJson, Strings.EMPTY); } @Test public void should_parseValidMultiLineString() { - String shapeJson = "{\"type\":\"MultiLineString\",\"coordinates\":[[[-105.021443,39.578057],[-105.021507,39.577809],[-105.021572,39.577495],[-105.021572,39.577164],[-105.021572,39.577032],[-105.021529,39.576784]],[[-105.019898,39.574997],[-105.019598,39.574898],[-105.019061,39.574782]],[[-105.017173,39.574402],[-105.01698,39.574385],[-105.016636,39.574385],[-105.016508,39.574402],[-105.01595,39.57427]],[[-105.014276,39.573972],[-105.014126,39.574038],[-105.013825,39.57417],[-105.01331,39.574452]]]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiLineString\",\"coordinates\":[[[-105.021443,39.578057],[-105.021507,39.577809],[-105.021572,39.577495],[-105.021572,39.577164],[-105.021572,39.577032],[-105.021529,39.576784]],[[-105.019898,39.574997],[-105.019598,39.574898],[-105.019061,39.574782]],[[-105.017173,39.574402],[-105.01698,39.574385],[-105.016636,39.574385],[-105.016508,39.574402],[-105.01595,39.57427]],[[-105.014276,39.573972],[-105.014126,39.574038],[-105.013825,39.57417],[-105.01331,39.574452]]]}}]}"; this.validateInput(this.sut::parseGeoJson, shapeJson, Strings.EMPTY); } @Test public void should_parseValidPolygon() { - String shapeJson = "{\"type\":\"Polygon\",\"coordinates\":[[[100,0],[101,0],[101,1],[100,1],[100,0]]]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[100,0],[101,0],[101,1],[100,1],[100,0]]]}}]}"; this.validateInput(this.sut::parseGeoJson, shapeJson, Strings.EMPTY); } @Test public void should_throwException_parseInvalidPolygon_malformedLatitude() { - String shapeJson = "{\"type\":\"Polygon\",\"coordinates\":[[[100,\"afgg\"],[101,0],[101,1],[100,1],[100,0]]]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[100,\"afgg\"],[101,0],[101,1],[100,1],[100,0]]]}}]}"; - this.validateInput(this.sut::parseGeoJson, shapeJson, "geo coordinates must be numbers"); + this.validateInput(this.sut::parseGeoJson, shapeJson, "unable to parse FeatureCollection"); } @Test public void should_parseValidMultiPolygon() { - String shapeJson = "{\"type\":\"MultiPolygon\",\"coordinates\":[[[[107,7],[108,7],[108,8],[107,8],[107,7]]],[[[100,0],[101,0],[101,1],[100,1],[100,0]]]]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[107,7],[108,7],[108,8],[107,8],[107,7]]],[[[100,0],[101,0],[101,1],[100,1],[100,0]]]]}}]}"; this.validateInput(this.sut::parseGeoJson, shapeJson, Strings.EMPTY); } @Test public void should_parseValidGeometryCollection() { - String shapeJson = "{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[-80.660805,35.049392]},{\"type\":\"Polygon\",\"coordinates\":[[[-80.664582,35.044965],[-80.663874,35.04428],[-80.662586,35.04558],[-80.663444,35.046036],[-80.664582,35.044965]]]},{\"type\":\"LineString\",\"coordinates\":[[-80.662372,35.059509],[-80.662693,35.059263],[-80.662844,35.05893],[-80.66308,35.058332],[-80.663595,35.057753],[-80.663874,35.057401],[-80.66441,35.057033],[-80.664861,35.056787],[-80.665419,35.056506],[-80.665633,35.056312],[-80.666019,35.055891],[-80.666191,35.055452],[-80.666191,35.055171],[-80.666255,35.05489],[-80.666213,35.054222],[-80.666213,35.053924],[-80.665955,35.052905],[-80.665698,35.052044],[-80.665504,35.051482],[-80.665762,35.050481],[-80.66617,35.049725],[-80.666513,35.049286],[-80.666921,35.048531],[-80.667006,35.048215],[-80.667071,35.047775],[-80.667049,35.047389],[-80.666964,35.046985],[-80.666813,35.046353],[-80.666599,35.045966],[-80.666406,35.045615],[-80.665998,35.045193],[-80.665526,35.044877],[-80.664989,35.044543],[-80.664496,35.044174],[-80.663852,35.043876],[-80.663037,35.043717]]}]}"; + String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[-80.660805,35.049392]},{\"type\":\"Polygon\",\"coordinates\":[[[-80.664582,35.044965],[-80.663874,35.04428],[-80.662586,35.04558],[-80.663444,35.046036],[-80.664582,35.044965]]]},{\"type\":\"LineString\",\"coordinates\":[[-80.662372,35.059509],[-80.662693,35.059263],[-80.662844,35.05893],[-80.66308,35.058332],[-80.663595,35.057753],[-80.663874,35.057401],[-80.66441,35.057033],[-80.664861,35.056787],[-80.665419,35.056506],[-80.665633,35.056312],[-80.666019,35.055891],[-80.666191,35.055452],[-80.666191,35.055171],[-80.666255,35.05489],[-80.666213,35.054222],[-80.666213,35.053924],[-80.665955,35.052905],[-80.665698,35.052044],[-80.665504,35.051482],[-80.665762,35.050481],[-80.66617,35.049725],[-80.666513,35.049286],[-80.666921,35.048531],[-80.667006,35.048215],[-80.667071,35.047775],[-80.667049,35.047389],[-80.666964,35.046985],[-80.666813,35.046353],[-80.666599,35.045966],[-80.666406,35.045615],[-80.665998,35.045193],[-80.665526,35.044877],[-80.664989,35.044543],[-80.664496,35.044174],[-80.663852,35.043876],[-80.663037,35.043717]]}]}}]}"; this.validateInput(this.sut::parseGeoJson, shapeJson, Strings.EMPTY); } @Test - public void should_throwException_parseUnsupportedType_featureCollection() { + public void should_parseValidFeatureCollection() { String shapeJson = "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[1.9496737127045984,58.41415669686543],[1.8237672363511042,58.42946998193435],[1.8422735102001124,58.471472136376455],[1.9683241046247606,58.45614207250076],[1.9496737127045984,58.41415669686543]]]}}]}"; - this.validateInput(this.sut::parseGeoJson, shapeJson, "unknown geo_shape [FeatureCollection]"); + this.validateInput(this.sut::parseGeoJson, shapeJson, Strings.EMPTY); } @Test public void should_throwException_parseUnsupportedType_feature() { String shapeJson = "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-80.724878,35.265454],[-80.722646,35.260338],[-80.720329,35.260618],[-80.718698,35.260267],[-80.715093,35.260548],[-80.71681,35.255361],[-80.710887,35.255361],[-80.703248,35.265033],[-80.704793,35.268397],[-80.70857,35.268257],[-80.712518,35.270359],[-80.715179,35.267696],[-80.721359,35.267276],[-80.724878,35.265454]]]},\"properties\":{\"name\":\"Plaza Road Park\"}}"; - this.validateInput(this.sut::parseGeoJson, shapeJson, "unknown geo_shape [Feature]"); + this.validateInput(this.sut::parseGeoJson, shapeJson, "must be a valid FeatureCollection"); } - private void validateInput(Function<Map<String, Object>, String> parser, String shapeJson, String errorMessage) { + private void validateInput(Function<Map<String, Object>, Map<String, Object>> parser, String shapeJson, String errorMessage) { try { Type type = new TypeToken<Map<String, Object>>() {}.getType(); Map<String, Object> shapeObj = new Gson().fromJson(shapeJson, type); - String parsedShape = parser.apply(shapeObj); + Map<String, Object> parsedShape = parser.apply(shapeObj); assertNotNull(parsedShape); + assertTrue(Strings.isNullOrEmpty(errorMessage)); } catch (IllegalArgumentException e) { - assertThat(String.format("Incorrect error message for geo-json parsing [ %s ]", shapeJson), - e.getMessage(), containsString(errorMessage)); + if (Strings.isNullOrEmpty(errorMessage)) { + fail(String.format("error parsing valid geo-json %s", shapeJson)); + } else { + assertThat(String.format("Incorrect error message for geo-json parsing [ %s ]", shapeJson), + e.getMessage(), containsString(errorMessage)); + } } } } diff --git a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/file/File.1.0.0.json.res b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/file/File.1.0.0.json.res index b0f71fc6fd26e27eb5dc2362e7667aa1d17c481e..d0cc00a8d3fe76d6ff446a8433c4b895e8a88316 100644 --- a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/file/File.1.0.0.json.res +++ b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/file/File.1.0.0.json.res @@ -40,6 +40,10 @@ { "kind": "string", "path": "Checksum" + }, + { + "kind": "[]object", + "path": "VectorHeaderMapping" } ] } \ No newline at end of file diff --git a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/master-data/Agreement.1.0.0.json.res b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/master-data/Agreement.1.0.0.json.res index 136ed0b7ecb61b50f82b8d8e213db03ab410f8da..8728c3bc5da175c23046b1f86381ef5eb99cbfe3 100644 --- a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/master-data/Agreement.1.0.0.json.res +++ b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/master-data/Agreement.1.0.0.json.res @@ -32,6 +32,14 @@ { "kind": "[]link", "path": "Counterparties" + }, + { + "kind": "[]object", + "path": "Terms" + }, + { + "kind": "[]object", + "path": "RestrictedResources" } ] } \ No newline at end of file diff --git a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product-component/WellLog.1.0.0.json.res b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product-component/WellLog.1.0.0.json.res index 517ca0395223bf432f8bc6b8c01bf7c768921532..359986f472e4ea54a08e6496b5230b914c3a80f0 100644 --- a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product-component/WellLog.1.0.0.json.res +++ b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product-component/WellLog.1.0.0.json.res @@ -76,6 +76,10 @@ { "kind": "string", "path": "VerticalMeasurementID" + }, + { + "kind": "[]object", + "path": "Curves" } ] } \ No newline at end of file diff --git a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product/WorkProduct.1.0.0.json.res b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product/WorkProduct.1.0.0.json.res index 0b807093bb76e1b01fa2c4d2753864bab6f52386..5852817c878ac55fcc522b6752635389135b40ae 100644 --- a/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product/WorkProduct.1.0.0.json.res +++ b/indexer-core/src/test/resources/converter/R3-json-schema/Generated/work-product/WorkProduct.1.0.0.json.res @@ -44,6 +44,10 @@ { "kind": "[]string", "path": "Annotations" + }, + { + "kind": "[]object", + "path": "LineageAssertions" } ] } \ No newline at end of file diff --git a/indexer-core/src/test/resources/converter/basic/schema.json b/indexer-core/src/test/resources/converter/basic/schema.json index 1c406a9e329acc9dca6c6e7f08088c52ab0f2195..67f2aae7b4c712c16d53b656eff0984ad822410e 100644 --- a/indexer-core/src/test/resources/converter/basic/schema.json +++ b/indexer-core/src/test/resources/converter/basic/schema.json @@ -39,14 +39,14 @@ "ancestry": { "description": "The links to data, which constitute the inputs.", "title": "Ancestry", - "$ref": "#/definitions/AbstractLegalParentList.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractLegalParentList:1.0.0" }, "meta": { "description": "The Frame of Reference meta data section linking the named properties to self-contained definitions.", "title": "Frame of Reference Meta Data", "type": "array", "items": { - "$ref": "#/definitions/AbstractMetaItem.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractMetaItem:1.0.0" } }, "source": { @@ -63,7 +63,7 @@ "data": { "allOf": [ { - "$ref": "#/definitions/AbstractFacility.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractFacility:1.0.0" }, { "type": "object", @@ -80,14 +80,14 @@ "description": "List of all depths and elevations pertaining to the wellbore, like, plug back measured depth, total measured depth, KB elevation", "type": "array", "items": { - "$ref": "#/definitions/AbstractFacilityVerticalMeasurement.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractFacilityVerticalMeasurement:1.0.0" } }, "DrillingReason": { "description": "The history of drilling reasons of the wellbore.", "type": "array", "items": { - "$ref": "#/definitions/AbstractWellboreDrillingReason.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractWellboreDrillingReason:1.0.0" } }, "KickOffWellbore": { @@ -121,11 +121,11 @@ }, "ProjectedBottomHoleLocation": { "description": "Projected location at total depth.", - "$ref": "#/definitions/AbstractSpatialLocation.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractSpatialLocation:1.0.0" }, "GeographicBottomHoleLocation": { "description": "Geographic location at total depth.", - "$ref": "#/definitions/AbstractSpatialLocation.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractSpatialLocation:1.0.0" } } }, @@ -149,7 +149,7 @@ ], "additionalProperties": false, "definitions": { - "AbstractAccessControlList.1.0.0": { + "opendes:wks:AbstractAccessControlList:1.0.0": { "title": "Access Control List", "description": "The access control tags associated with this entity. This structure is included by the SystemProperties \"acl\", which is part of all OSDU records. Not extensible.", "type": "object", @@ -179,7 +179,7 @@ ], "additionalProperties": false }, - "AbstractLegalTags.1.0.0": { + "opendes:wks:AbstractLegalTags:1.0.0": { "title": "Legal Meta Data", "description": "Legal meta data like legal tags, relevant other countries, legal status. This structure is included by the SystemProperties \"legal\", which is part of all OSDU records. Not extensible.", "type": "object", @@ -214,7 +214,7 @@ ], "additionalProperties": false }, - "AbstractLegalParentList.1.0.0": { + "opendes:wks:AbstractLegalParentList:1.0.0": { "title": "Parent List", "description": "A list of entity IDs in the data ecosystem, which act as legal parents to the current entity. This structure is included by the SystemProperties \"ancestry\", which is part of all OSDU records. Not extensible.", "type": "object", @@ -231,7 +231,7 @@ }, "additionalProperties": false }, - "AbstractMetaItem.1.0.0": { + "opendes:wks:AbstractMetaItem:1.0.0": { "title": "Frame of Reference Meta Data Item", "description": "A meta data item, which allows the association of named properties or property values to a Unit/Measurement/CRS/Azimuth/Time context.", "oneOf": [ @@ -404,7 +404,7 @@ } ] }, - "AbstractFacilityOperator.1.0.0": { + "opendes:wks:AbstractFacilityOperator:1.0.0": { "title": "AbstractFacilityOperator", "description": "The organisation that was responsible for a facility at some point in time.", "type": "object", @@ -426,7 +426,7 @@ } } }, - "AbstractAnyCrsFeatureCollection.1.0.0": { + "opendes:wks:AbstractAnyCrsFeatureCollection:1.0.0": { "title": "AbstractAnyCrsFeatureCollection", "description": "A schema like GeoJSON FeatureCollection with a non-WGS 84 CRS context; based on https://geojson.org/schema/FeatureCollection.json. Attention: the coordinate order is fixed: Longitude/Easting/Westing/X first, followed by Latitude/Northing/Southing/Y, optionally height as third coordinate.", "type": "object", @@ -979,7 +979,7 @@ } } }, - "AbstractFeatureCollection.1.0.0": { + "opendes:wks:AbstractFeatureCollection:1.0.0": { "description": "GeoJSON feature collection as originally published in https://geojson.org/schema/FeatureCollection.json. Attention: the coordinate order is fixed: Longitude first, followed by Latitude, optionally height above MSL (EPSG:5714) as third coordinate.", "title": "GeoJSON FeatureCollection", "type": "object", @@ -1499,7 +1499,7 @@ } } }, - "AbstractSpatialLocation.1.0.0": { + "opendes:wks:AbstractSpatialLocation:1.0.0": { "title": "AbstractSpatialLocation", "description": "A geographic object which can be described by a set of points.", "type": "object", @@ -1538,13 +1538,13 @@ "AsIngestedCoordinates": { "title": "As Ingested Coordinates", "description": "The original or 'as ingested' coordinates (Point, MultiPoint, LineString, MultiLineString, Polygon or MultiPolygon). The name 'AsIngestedCoordinates' was chosen to contrast it to 'OriginalCoordinates', which carries the uncertainty whether any coordinate operations took place before ingestion. In cases where the original CRS is different from the as-ingested CRS, the OperationsApplied can also contain the list of operations applied to the coordinate prior to ingestion. The data structure is similar to GeoJSON FeatureCollection, however in a CRS context explicitly defined within the AbstractAnyCrsFeatureCollection. The coordinate sequence follows GeoJSON standard, i.e. 'eastward/longitude', 'northward/latitude' {, 'upward/height' unless overridden by an explicit direction in the AsIngestedCoordinates.VerticalCoordinateReferenceSystemID}.", - "$ref": "#/definitions/AbstractAnyCrsFeatureCollection.1.0.0", + "$ref": "#/definitions/opendes:wks:AbstractAnyCrsFeatureCollection:1.0.0", "x-osdu-frame-of-reference": "CRS:" }, "Wgs84Coordinates": { "title": "WGS 84 Coordinates", "description": "The normalized coordinates (Point, MultiPoint, LineString, MultiLineString, Polygon or MultiPolygon) based on WGS 84 (EPSG:4326 for 2-dimensional coordinates, EPSG:4326 + EPSG:5714 (MSL) for 3-dimensional coordinates). This derived coordinate representation is intended for global discoverability only. The schema of this substructure is identical to the GeoJSON FeatureCollection https://geojson.org/schema/FeatureCollection.json. The coordinate sequence follows GeoJSON standard, i.e. longitude, latitude {, height}", - "$ref": "#/definitions/AbstractFeatureCollection.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractFeatureCollection:1.0.0" }, "OperationsApplied": { "title": "Operations Applied", @@ -1570,7 +1570,7 @@ } } }, - "AbstractGeoPoliticalContext.1.0.0": { + "opendes:wks:AbstractGeoPoliticalContext:1.0.0": { "title": "AbstractGeoPoliticalContext", "description": "A single, typed geo-political entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", "type": "object", @@ -1587,7 +1587,7 @@ } } }, - "AbstractGeoBasinContext.1.0.0": { + "opendes:wks:AbstractGeoBasinContext:1.0.0": { "title": "AbstractGeoBasinContext", "description": "A single, typed basin entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", "type": "object", @@ -1604,7 +1604,7 @@ } } }, - "AbstractGeoFieldContext.1.0.0": { + "opendes:wks:AbstractGeoFieldContext:1.0.0": { "title": "AbstractGeoFieldContext", "description": "A single, typed field entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", "type": "object", @@ -1620,7 +1620,7 @@ } } }, - "AbstractGeoPlayContext.1.0.0": { + "opendes:wks:AbstractGeoPlayContext:1.0.0": { "title": "AbstractGeoPlayContext", "description": "A single, typed Play entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", "type": "object", @@ -1637,7 +1637,7 @@ } } }, - "AbstractGeoProspectContext.1.0.0": { + "opendes:wks:AbstractGeoProspectContext:1.0.0": { "title": "AbstractGeoProspectContext", "description": "A single, typed Prospect entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", "type": "object", @@ -1654,28 +1654,28 @@ } } }, - "AbstractGeoContext.1.0.0": { + "opendes:wks:AbstractGeoContext:1.0.0": { "title": "AbstractGeoContext", "description": "A geographic context to an entity. It can be either a reference to a GeoPoliticalEntity, Basin, Field, Play or Prospect.", "oneOf": [ { - "$ref": "#/definitions/AbstractGeoPoliticalContext.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractGeoPoliticalContext:1.0.0" }, { - "$ref": "#/definitions/AbstractGeoBasinContext.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractGeoBasinContext:1.0.0" }, { - "$ref": "#/definitions/AbstractGeoFieldContext.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractGeoFieldContext:1.0.0" }, { - "$ref": "#/definitions/AbstractGeoPlayContext.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractGeoPlayContext:1.0.0" }, { - "$ref": "#/definitions/AbstractGeoProspectContext.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractGeoProspectContext:1.0.0" } ] }, - "AbstractAliasNames.1.0.0": { + "opendes:wks:AbstractAliasNames:1.0.0": { "title": "AbstractAliasNames", "description": "A list of alternative names for an object. The preferred name is in a separate, scalar property. It may or may not be repeated in the alias list, though a best practice is to include it if the list is present, but to omit the list if there are no other names. Note that the abstract entity is an array so the $ref to it is a simple property reference.", "type": "object", @@ -1706,7 +1706,7 @@ } } }, - "AbstractFacilityState.1.0.0": { + "opendes:wks:AbstractFacilityState:1.0.0": { "title": "AbstractFacilityState", "description": "The life cycle status of a facility at some point in time.", "type": "object", @@ -1728,7 +1728,7 @@ } } }, - "AbstractFacilityEvent.1.0.0": { + "opendes:wks:AbstractFacilityEvent:1.0.0": { "title": "AbstractFacilityEvent", "description": "A significant occurrence in the life of a facility, which often changes its state, or the state of one of its components.", "type": "object", @@ -1750,7 +1750,7 @@ } } }, - "AbstractFacilitySpecification.1.0.0": { + "opendes:wks:AbstractFacilitySpecification:1.0.0": { "title": "AbstractFacilitySpecification", "description": "A property, characteristic, or attribute about a facility that is not described explicitly elsewhere.", "type": "object", @@ -1795,7 +1795,7 @@ } } }, - "AbstractFacility.1.0.0": { + "opendes:wks:AbstractFacility:1.0.0": { "title": "AbstractFacility", "description": "", "type": "object", @@ -1813,7 +1813,7 @@ "description": "The history of operator organizations of the facility.", "type": "array", "items": { - "$ref": "#/definitions/AbstractFacilityOperator.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractFacilityOperator:1.0.0" } }, "DataSourceOrganisationID": { @@ -1825,14 +1825,14 @@ "description": "The spatial location information such as coordinates,CRS information.", "type": "array", "items": { - "$ref": "#/definitions/AbstractSpatialLocation.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractSpatialLocation:1.0.0" } }, "GeoContexts": { "description": "List of geographic entities which provide context to the facility. This may include multiple types or multiple values of the same type.", "type": "array", "items": { - "$ref": "#/definitions/AbstractGeoContext.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractGeoContext:1.0.0" } }, "OperatingEnvironmentID": { @@ -1848,33 +1848,33 @@ "description": "Alternative names, including historical, by which this facility is/has been known.", "type": "array", "items": { - "$ref": "#/definitions/AbstractAliasNames.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractAliasNames:1.0.0" } }, "FacilityState": { "description": "The history of life cycle states the facility has been through.", "type": "array", "items": { - "$ref": "#/definitions/AbstractFacilityState.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractFacilityState:1.0.0" } }, "FacilityEvent": { "description": "A list of key facility events.", "type": "array", "items": { - "$ref": "#/definitions/AbstractFacilityEvent.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractFacilityEvent:1.0.0" } }, "FacilitySpecification": { "description": "facilitySpecification maintains the specification like slot name, wellbore drilling permit number, rig name etc.", "type": "array", "items": { - "$ref": "#/definitions/AbstractFacilitySpecification.1.0.0" + "$ref": "#/definitions/opendes:wks:AbstractFacilitySpecification:1.0.0" } } } }, - "AbstractFacilityVerticalMeasurement.1.0.0": { + "opendes:wks:AbstractFacilityVerticalMeasurement:1.0.0": { "title": "AbstractFacilityVerticalMeasurement", "description": "A location along a wellbore, _usually_ associated with some aspect of the drilling of the wellbore, but not with any intersecting _subsurface_ natural surfaces.", "type": "object", @@ -1938,7 +1938,7 @@ } } }, - "AbstractWellboreDrillingReason.1.0.0": { + "opendes:wks:AbstractWellboreDrillingReason:1.0.0": { "title": "AbstractWellboreDrillingReason", "description": "Purpose for drilling a wellbore, which often is an indication of the level of risk.", "type": "object", diff --git a/indexer-core/src/test/resources/converter/integration-tests/index_records_1.schema b/indexer-core/src/test/resources/converter/integration-tests/index_records_1.schema index 779d2d20921f97aa86bed06943358d76c3d5f71f..59cdd5a655bd522173f94e016cee9af421942fb5 100644 --- a/indexer-core/src/test/resources/converter/integration-tests/index_records_1.schema +++ b/indexer-core/src/test/resources/converter/integration-tests/index_records_1.schema @@ -9,7 +9,7 @@ "type": "string" }, "Location": { - "$ref": "#/definitions/core_dl_geopoint", + "$ref": "#/definitions/opendes:wks:core_dl_geopoint:1.0.0", "description": "The wellbore's position .", "format": "core:dl:geopoint:1.0.0", "title": "WGS 84 Position", diff --git a/indexer-core/src/test/resources/converter/integration-tests/index_records_2.schema b/indexer-core/src/test/resources/converter/integration-tests/index_records_2.schema index cf5f858c3e9b8b04b9bca08c1b834de2b784bf6a..6e923af9614be3b8ee991f161d934db68b8fe31a 100644 --- a/indexer-core/src/test/resources/converter/integration-tests/index_records_2.schema +++ b/indexer-core/src/test/resources/converter/integration-tests/index_records_2.schema @@ -9,7 +9,7 @@ "type": "string" }, "Location": { - "$ref": "#/definitions/core_dl_geopoint", + "$ref": "#/definitions/opendes:wks:core_dl_geopoint:1.0.0", "description": "The wellbore's position .", "format": "core:dl:geopoint:1.0.0", "title": "WGS 84 Position", diff --git a/indexer-core/src/test/resources/converter/integration-tests/index_records_3.schema b/indexer-core/src/test/resources/converter/integration-tests/index_records_3.schema index 802d4493804948ecd9b896af700cbfaa8f00939d..07c410a27fb31190ea48d35fe2086ca4988bc553 100644 --- a/indexer-core/src/test/resources/converter/integration-tests/index_records_3.schema +++ b/indexer-core/src/test/resources/converter/integration-tests/index_records_3.schema @@ -6,7 +6,7 @@ "type": "object", "properties": { "GeoShape": { - "$ref": "#/definitions/geoJsonFeatureCollection", + "$ref": "#/definitions/opendes:wks:geoJsonFeatureCollection:1.0.0", "description": "The wellbore's position .", "format": "core:dl:geopoint:1.0.0", "title": "WGS 84 Position", diff --git a/indexer-core/src/test/resources/converter/new-definitions-format/colons-sample.json b/indexer-core/src/test/resources/converter/new-definitions-format/colons-sample.json new file mode 100644 index 0000000000000000000000000000000000000000..b35fc4d30b923bcd373c78c1214b48bf7b21898f --- /dev/null +++ b/indexer-core/src/test/resources/converter/new-definitions-format/colons-sample.json @@ -0,0 +1,1999 @@ +{ + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:master-data--Test:1.0.0", + "description": "Enter a meaningful description for Test.", + "title": "Test", + "type": "object", + "x-osdu-review-status": "Pending", + "required": [ + "kind", + "acl", + "legal" + ], + "additionalProperties": false, + "definitions": { + "opendes:wks:AbstractGeoPoliticalContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoPoliticalContext:1.0.0", + "description": "A single, typed geo-political entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", + "x-osdu-review-status": "Accepted", + "title": "AbstractGeoPoliticalContext", + "type": "object", + "properties": { + "GeoPoliticalEntityID": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-GeoPoliticalEntity:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Reference to GeoPoliticalEntity.", + "x-osdu-relationship": [ + { + "EntityType": "GeoPoliticalEntity", + "GroupType": "master-data" + } + ], + "type": "string" + }, + "GeoTypeID": { + "x-osdu-is-derived": { + "RelationshipPropertyName": "GeoPoliticalEntityID", + "TargetPropertyName": "GeoPoliticalEntityTypeID" + }, + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-GeoPoliticalEntityType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The GeoPoliticalEntityType reference of the GeoPoliticalEntity (via GeoPoliticalEntityID) for application convenience.", + "x-osdu-relationship": [ + { + "EntityType": "GeoPoliticalEntityType", + "GroupType": "reference-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoPoliticalContext.1.0.0.json" + }, + "opendes:wks:AbstractCommonResources:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractCommonResources:1.0.0", + "description": "Common resources to be injected at root 'data' level for every entity, which is persistable in Storage. The insertion is performed by the OsduSchemaComposer script.", + "title": "OSDU Common Resources", + "type": "object", + "properties": { + "ResourceHomeRegionID": { + "x-osdu-relationship": [ + { + "EntityType": "OSDURegion", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-OSDURegion:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The name of the home [cloud environment] region for this OSDU resource object.", + "title": "Resource Home Region ID", + "type": "string" + }, + "ResourceHostRegionIDs": { + "description": "The name of the host [cloud environment] region(s) for this OSDU resource object.", + "title": "Resource Host Region ID", + "type": "array", + "items": { + "x-osdu-relationship": [ + { + "EntityType": "OSDURegion", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-OSDURegion:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "type": "string" + } + }, + "ResourceLifecycleStatus": { + "x-osdu-relationship": [ + { + "EntityType": "ResourceLifecycleStatus", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-ResourceLifecycleStatus:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Describes the current Resource Lifecycle status.", + "title": "Resource Lifecycle Status", + "type": "string" + }, + "ResourceSecurityClassification": { + "x-osdu-relationship": [ + { + "EntityType": "ResourceSecurityClassification", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-ResourceSecurityClassification:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Classifies the security level of the resource.", + "title": "Resource Security Classification", + "type": "string" + }, + "ResourceCurationStatus": { + "x-osdu-relationship": [ + { + "EntityType": "ResourceCurationStatus", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-ResourceCurationStatus:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Describes the current Curation status.", + "title": "Resource Curation Status", + "type": "string" + }, + "ExistenceKind": { + "x-osdu-relationship": [ + { + "EntityType": "ExistenceKind", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-ExistenceKind:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Where does this data resource sit in the cradle-to-grave span of its existence?", + "title": "Existence Kind", + "type": "string" + }, + "Source": { + "description": "The entity that produced the record, or from which it is received; could be an organization, agency, system, internal team, or individual. For informational purposes only, the list of sources is not governed.", + "title": "Data Source", + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractCommonResources.1.0.0.json" + }, + "opendes:wks:AbstractAliasNames:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractAliasNames:1.0.0", + "description": "A list of alternative names for an object. The preferred name is in a separate, scalar property. It may or may not be repeated in the alias list, though a best practice is to include it if the list is present, but to omit the list if there are no other names. Note that the abstract entity is an array so the $ref to it is a simple property reference.", + "x-osdu-review-status": "Accepted", + "title": "AbstractAliasNames", + "type": "object", + "properties": { + "AliasNameTypeID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-AliasNameType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "A classification of alias names such as by role played or type of source, such as regulatory name, regulatory code, company code, international standard name, etc.", + "x-osdu-relationship": [ + { + "EntityType": "AliasNameType", + "GroupType": "reference-data" + } + ], + "type": "string" + }, + "EffectiveDateTime": { + "format": "date-time", + "type": "string", + "description": "The date and time when an alias name becomes effective." + }, + "AliasName": { + "type": "string", + "description": "Alternative Name value of defined name type for an object." + }, + "TerminationDateTime": { + "format": "date-time", + "type": "string", + "description": "The data and time when an alias name is no longer in effect." + }, + "DefinitionOrganisationID": { + "pattern": "^[\\w\\-\\.]+:(reference-data\\-\\-StandardsOrganisation|master-data\\-\\-Organisation):[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The StandardsOrganisation (reference-data) or Organisation (master-data) that provided the name (the source).", + "x-osdu-relationship": [ + { + "EntityType": "StandardsOrganisation", + "GroupType": "reference-data" + }, + { + "EntityType": "Organisation", + "GroupType": "master-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractAliasNames.1.0.0.json" + }, + "opendes:wks:AbstractAnyCrsFeatureCollection:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractAnyCrsFeatureCollection:1.0.0", + "description": "A schema like GeoJSON FeatureCollection with a non-WGS 84 CRS context; based on https://geojson.org/schema/FeatureCollection.json. Attention: the coordinate order is fixed: Longitude/Easting/Westing/X first, followed by Latitude/Northing/Southing/Y, optionally height as third coordinate.", + "title": "AbstractAnyCrsFeatureCollection", + "type": "object", + "required": [ + "type", + "persistableReferenceCrs", + "features" + ], + "properties": { + "CoordinateReferenceSystemID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-CoordinateReferenceSystem:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The CRS reference into the CoordinateReferenceSystem catalog.", + "x-osdu-relationship": [ + { + "EntityType": "CoordinateReferenceSystem", + "GroupType": "reference-data" + } + ], + "title": "Coordinate Reference System ID", + "type": "string", + "example": "namespace:reference-data--CoordinateReferenceSystem:BoundCRS.SLB.32021.15851:" + }, + "persistableReferenceCrs": { + "description": "The CRS reference as persistableReference string. If populated, the CoordinateReferenceSystemID takes precedence.", + "type": "string", + "title": "CRS Reference", + "example": "{\"lateBoundCRS\":{\"wkt\":\"PROJCS[\\\"NAD_1927_StatePlane_North_Dakota_South_FIPS_3302\\\",GEOGCS[\\\"GCS_North_American_1927\\\",DATUM[\\\"D_North_American_1927\\\",SPHEROID[\\\"Clarke_1866\\\",6378206.4,294.9786982]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],PROJECTION[\\\"Lambert_Conformal_Conic\\\"],PARAMETER[\\\"False_Easting\\\",2000000.0],PARAMETER[\\\"False_Northing\\\",0.0],PARAMETER[\\\"Central_Meridian\\\",-100.5],PARAMETER[\\\"Standard_Parallel_1\\\",46.1833333333333],PARAMETER[\\\"Standard_Parallel_2\\\",47.4833333333333],PARAMETER[\\\"Latitude_Of_Origin\\\",45.6666666666667],UNIT[\\\"Foot_US\\\",0.304800609601219],AUTHORITY[\\\"EPSG\\\",32021]]\",\"ver\":\"PE_10_3_1\",\"name\":\"NAD_1927_StatePlane_North_Dakota_South_FIPS_3302\",\"authCode\":{\"auth\":\"EPSG\",\"code\":\"32021\"},\"type\":\"LBC\"},\"singleCT\":{\"wkt\":\"GEOGTRAN[\\\"NAD_1927_To_WGS_1984_79_CONUS\\\",GEOGCS[\\\"GCS_North_American_1927\\\",DATUM[\\\"D_North_American_1927\\\",SPHEROID[\\\"Clarke_1866\\\",6378206.4,294.9786982]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],GEOGCS[\\\"GCS_WGS_1984\\\",DATUM[\\\"D_WGS_1984\\\",SPHEROID[\\\"WGS_1984\\\",6378137.0,298.257223563]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],METHOD[\\\"NADCON\\\"],PARAMETER[\\\"Dataset_conus\\\",0.0],AUTHORITY[\\\"EPSG\\\",15851]]\",\"ver\":\"PE_10_3_1\",\"name\":\"NAD_1927_To_WGS_1984_79_CONUS\",\"authCode\":{\"auth\":\"EPSG\",\"code\":\"15851\"},\"type\":\"ST\"},\"ver\":\"PE_10_3_1\",\"name\":\"NAD27 * OGP-Usa Conus / North Dakota South [32021,15851]\",\"authCode\":{\"auth\":\"SLB\",\"code\":\"32021079\"},\"type\":\"EBC\"}" + }, + "features": { + "type": "array", + "items": { + "title": "AnyCrsGeoJSON Feature", + "type": "object", + "required": [ + "type", + "properties", + "geometry" + ], + "properties": { + "geometry": { + "oneOf": [ + { + "type": "null" + }, + { + "title": "AnyCrsGeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON GeometryCollection", + "type": "object", + "required": [ + "type", + "geometries" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "AnyCrsGeometryCollection" + ] + }, + "geometries": { + "type": "array", + "items": { + "oneOf": [ + { + "title": "AnyCrsGeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + ] + } + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + ] + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsFeature" + ] + }, + "properties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object" + } + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "persistableReferenceUnitZ": { + "description": "The unit of measure for the Z-axis (only for 3-dimensional coordinates, where the CRS does not describe the vertical unit). Note that the direction is upwards positive, i.e. Z means height.", + "type": "string", + "title": "Z-Unit Reference", + "example": "{\"scaleOffset\":{\"scale\":1.0,\"offset\":0.0},\"symbol\":\"m\",\"baseMeasurement\":{\"ancestry\":\"Length\",\"type\":\"UM\"},\"type\":\"USO\"}" + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + }, + "persistableReferenceVerticalCrs": { + "description": "The VerticalCRS reference as persistableReference string. If populated, the VerticalCoordinateReferenceSystemID takes precedence. The property is null or empty for 2D geometries. For 3D geometries and absent or null persistableReferenceVerticalCrs the vertical CRS is either provided via persistableReferenceCrs's CompoundCRS or it is implicitly defined as EPSG:5714 MSL height.", + "type": "string", + "title": "Vertical CRS Reference", + "example": "{\"authCode\":{\"auth\":\"EPSG\",\"code\":\"5773\"},\"type\":\"LBC\",\"ver\":\"PE_10_3_1\",\"name\":\"EGM96_Geoid\",\"wkt\":\"VERTCS[\\\"EGM96_Geoid\\\",VDATUM[\\\"EGM96_Geoid\\\"],PARAMETER[\\\"Vertical_Shift\\\",0.0],PARAMETER[\\\"Direction\\\",1.0],UNIT[\\\"Meter\\\",1.0],AUTHORITY[\\\"EPSG\\\",5773]]\"}" + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsFeatureCollection" + ] + }, + "VerticalCoordinateReferenceSystemID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-CoordinateReferenceSystem:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The explicit VerticalCRS reference into the CoordinateReferenceSystem catalog. This property stays empty for 2D geometries. Absent or empty values for 3D geometries mean the context may be provided by a CompoundCRS in 'CoordinateReferenceSystemID' or implicitly EPSG:5714 MSL height", + "x-osdu-relationship": [ + { + "EntityType": "CoordinateReferenceSystem", + "GroupType": "reference-data" + } + ], + "title": "Vertical Coordinate Reference System ID", + "type": "string", + "example": "namespace:reference-data--CoordinateReferenceSystem:VerticalCRS.EPSG.5773:" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractAnyCrsFeatureCollection:1.0.0.json" + }, + "opendes:wks:AbstractMetaItem:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "oneOf": [ + { + "title": "FrameOfReferenceUOM", + "type": "object", + "properties": { + "persistableReference": { + "description": "The self-contained, persistable reference string uniquely identifying the Unit.", + "title": "UOM Persistable Reference", + "type": "string", + "example": "{\"abcd\":{\"a\":0.0,\"b\":1200.0,\"c\":3937.0,\"d\":0.0},\"symbol\":\"ft[US]\",\"baseMeasurement\":{\"ancestry\":\"L\",\"type\":\"UM\"},\"type\":\"UAD\"}" + }, + "kind": { + "const": "Unit", + "description": "The kind of reference, 'Unit' for FrameOfReferenceUOM.", + "title": "UOM Reference Kind" + }, + "propertyNames": { + "description": "The list of property names, to which this meta data item provides Unit context to. Data structures, which come in a single frame of reference, can register the property name, others require a full path like \"Data.StructureA.PropertyB\" to define a unique context.", + "title": "UOM Property Names", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "HorizontalDeflection.EastWest", + "HorizontalDeflection.NorthSouth" + ] + }, + "name": { + "description": "The unit symbol or name of the unit.", + "title": "UOM Unit Symbol", + "type": "string", + "example": "ft[US]" + }, + "unitOfMeasureID": { + "x-osdu-relationship": [ + { + "EntityType": "UnitOfMeasure", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-UnitOfMeasure:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "SRN to unit of measure reference.", + "type": "string", + "example": "namespace:reference-data--UnitOfMeasure:ftUS:" + } + }, + "required": [ + "kind", + "persistableReference" + ] + }, + { + "title": "FrameOfReferenceCRS", + "type": "object", + "properties": { + "coordinateReferenceSystemID": { + "x-osdu-relationship": [ + { + "EntityType": "CoordinateReferenceSystem", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-CoordinateReferenceSystem:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "SRN to CRS reference.", + "type": "string", + "example": "namespace:reference-data--CoordinateReferenceSystem:EPSG.32615:" + }, + "persistableReference": { + "description": "The self-contained, persistable reference string uniquely identifying the CRS.", + "title": "CRS Persistable Reference", + "type": "string", + "example": "{\"authCode\":{\"auth\":\"EPSG\",\"code\":\"32615\"},\"type\":\"LBC\",\"ver\":\"PE_10_3_1\",\"name\":\"WGS_1984_UTM_Zone_15N\",\"wkt\":\"PROJCS[\\\"WGS_1984_UTM_Zone_15N\\\",GEOGCS[\\\"GCS_WGS_1984\\\",DATUM[\\\"D_WGS_1984\\\",SPHEROID[\\\"WGS_1984\\\",6378137.0,298.257223563]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],PROJECTION[\\\"Transverse_Mercator\\\"],PARAMETER[\\\"False_Easting\\\",500000.0],PARAMETER[\\\"False_Northing\\\",0.0],PARAMETER[\\\"Central_Meridian\\\",-93.0],PARAMETER[\\\"Scale_Factor\\\",0.9996],PARAMETER[\\\"Latitude_Of_Origin\\\",0.0],UNIT[\\\"Meter\\\",1.0],AUTHORITY[\\\"EPSG\\\",32615]]\"}" + }, + "kind": { + "const": "CRS", + "description": "The kind of reference, constant 'CRS' for FrameOfReferenceCRS.", + "title": "CRS Reference Kind" + }, + "propertyNames": { + "description": "The list of property names, to which this meta data item provides CRS context to. Data structures, which come in a single frame of reference, can register the property name, others require a full path like \"Data.StructureA.PropertyB\" to define a unique context.", + "title": "CRS Property Names", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "KickOffPosition.X", + "KickOffPosition.Y" + ] + }, + "name": { + "description": "The name of the CRS.", + "title": "CRS Name", + "type": "string", + "example": "NAD27 * OGP-Usa Conus / North Dakota South [32021,15851]" + } + }, + "required": [ + "kind", + "persistableReference" + ] + }, + { + "title": "FrameOfReferenceDateTime", + "type": "object", + "properties": { + "persistableReference": { + "description": "The self-contained, persistable reference string uniquely identifying DateTime reference.", + "title": "DateTime Persistable Reference", + "type": "string", + "example": "{\"format\":\"yyyy-MM-ddTHH:mm:ssZ\",\"timeZone\":\"UTC\",\"type\":\"DTM\"}" + }, + "kind": { + "const": "DateTime", + "description": "The kind of reference, constant 'DateTime', for FrameOfReferenceDateTime.", + "title": "DateTime Reference Kind" + }, + "propertyNames": { + "description": "The list of property names, to which this meta data item provides DateTime context to. Data structures, which come in a single frame of reference, can register the property name, others require a full path like \"Data.StructureA.PropertyB\" to define a unique context.", + "title": "DateTime Property Names", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "Acquisition.StartTime", + "Acquisition.EndTime" + ] + }, + "name": { + "description": "The name of the DateTime format and reference.", + "title": "DateTime Name", + "type": "string", + "example": "UTC" + } + }, + "required": [ + "kind", + "persistableReference" + ] + }, + { + "title": "FrameOfReferenceAzimuthReference", + "type": "object", + "properties": { + "persistableReference": { + "description": "The self-contained, persistable reference string uniquely identifying AzimuthReference.", + "title": "AzimuthReference Persistable Reference", + "type": "string", + "example": "{\"code\":\"TrueNorth\",\"type\":\"AZR\"}" + }, + "kind": { + "const": "AzimuthReference", + "description": "The kind of reference, constant 'AzimuthReference', for FrameOfReferenceAzimuthReference.", + "title": "AzimuthReference Reference Kind" + }, + "propertyNames": { + "description": "The list of property names, to which this meta data item provides AzimuthReference context to. Data structures, which come in a single frame of reference, can register the property name, others require a full path like \"Data.StructureA.PropertyB\" to define a unique context.", + "title": "AzimuthReference Property Names", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "Bearing" + ] + }, + "name": { + "description": "The name of the CRS or the symbol/name of the unit.", + "title": "AzimuthReference Name", + "type": "string", + "example": "TrueNorth" + } + }, + "required": [ + "kind", + "persistableReference" + ] + } + ], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractMetaItem:1.0.0", + "description": "A meta data item, which allows the association of named properties or property values to a Unit/Measurement/CRS/Azimuth/Time context.", + "title": "Frame of Reference Meta Data Item", + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractMetaItem.1.0.0.json" + }, + "opendes:wks:AbstractGeoContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "oneOf": [ + { + "$ref": "#/definitions/opendes:wks:AbstractGeoPoliticalContext:1.0.0" + }, + { + "$ref": "#/definitions/opendes:wks:AbstractGeoBasinContext:1.0.0" + }, + { + "$ref": "#/definitions/opendes:wks:AbstractGeoFieldContext:1.0.0" + }, + { + "$ref": "#/definitions/opendes:wks:AbstractGeoPlayContext:1.0.0" + }, + { + "$ref": "#/definitions/opendes:wks:AbstractGeoProspectContext:1.0.0" + } + ], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoContext:1.0.0", + "description": "A geographic context to an entity. It can be either a reference to a GeoPoliticalEntity, Basin, Field, Play or Prospect.", + "title": "AbstractGeoContext", + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoContext.1.0.0.json" + }, + "opendes:wks:AbstractLegalTags:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractLegalTags:1.0.0", + "description": "Legal meta data like legal tags, relevant other countries, legal status. This structure is included by the SystemProperties \"legal\", which is part of all OSDU records. Not extensible.", + "additionalProperties": false, + "title": "Legal Meta Data", + "type": "object", + "properties": { + "legaltags": { + "description": "The list of legal tags, which resolve to legal properties (like country of origin, export classification code, etc.) and rules with the help of the Compliance Service.", + "title": "Legal Tags", + "type": "array", + "items": { + "type": "string" + } + }, + "otherRelevantDataCountries": { + "description": "The list of other relevant data countries as an array of two-letter country codes, see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2.", + "title": "Other Relevant Data Countries", + "type": "array", + "items": { + "pattern": "^[A-Z]{2}$", + "type": "string" + } + }, + "status": { + "pattern": "^(compliant|uncompliant)$", + "description": "The legal status. Set by the system after evaluation against the compliance rules associated with the \"legaltags\" using the Compliance Service.", + "title": "Legal Status", + "type": "string" + } + }, + "required": [ + "legaltags", + "otherRelevantDataCountries" + ], + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractLegalTags.1.0.0.json" + }, + "opendes:wks:AbstractGeoBasinContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoBasinContext:1.0.0", + "description": "A single, typed basin entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", + "x-osdu-review-status": "Accepted", + "title": "AbstractGeoBasinContext", + "type": "object", + "properties": { + "BasinID": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-Basin:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Reference to Basin.", + "x-osdu-relationship": [ + { + "EntityType": "Basin", + "GroupType": "master-data" + } + ], + "type": "string" + }, + "GeoTypeID": { + "x-osdu-is-derived": { + "RelationshipPropertyName": "BasinID", + "TargetPropertyName": "BasinTypeID" + }, + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-BasinType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The BasinType reference of the Basin (via BasinID) for application convenience.", + "x-osdu-relationship": [ + { + "EntityType": "BasinType", + "GroupType": "reference-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoBasinContext.1.0.0.json" + }, + "opendes:wks:AbstractMaster:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractMaster:1.0.0", + "description": "Properties shared with all master-data schema instances.", + "x-osdu-review-status": "Accepted", + "title": "Abstract Master", + "type": "object", + "properties": { + "NameAliases": { + "description": "Alternative names, including historical, by which this master data is/has been known (it should include all the identifiers).", + "type": "array", + "items": { + "$ref": "#/definitions/opendes:wks:AbstractAliasNames:1.0.0" + } + }, + "SpatialLocation": { + "description": "The spatial location information such as coordinates, CRS information (left empty when not appropriate).", + "$ref": "#/definitions/opendes:wks:AbstractSpatialLocation:1.0.0" + }, + "VersionCreationReason": { + "description": "This describes the reason that caused the creation of a new version of this master data.", + "type": "string" + }, + "GeoContexts": { + "description": "List of geographic entities which provide context to the master data. This may include multiple types or multiple values of the same type.", + "type": "array", + "items": { + "$ref": "#/definitions/opendes:wks:AbstractGeoContext:1.0.0" + } + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractMaster.1.0.0.json" + }, + "opendes:wks:AbstractGeoProspectContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoProspectContext:1.0.0", + "description": "A single, typed Prospect entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", + "x-osdu-review-status": "Accepted", + "title": "AbstractGeoProspectContext", + "type": "object", + "properties": { + "ProspectID": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-Prospect:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Reference to the prospect.", + "x-osdu-relationship": [ + { + "EntityType": "Prospect", + "GroupType": "master-data" + } + ], + "type": "string" + }, + "GeoTypeID": { + "x-osdu-is-derived": { + "RelationshipPropertyName": "ProspectID", + "TargetPropertyName": "ProspectTypeID" + }, + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-ProspectType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The ProspectType reference of the Prospect (via ProspectID) for application convenience.", + "x-osdu-relationship": [ + { + "EntityType": "ProspectType", + "GroupType": "reference-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoProspectContext.1.0.0.json" + }, + "opendes:wks:AbstractSpatialLocation:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractSpatialLocation:1.0.0", + "description": "A geographic object which can be described by a set of points.", + "title": "AbstractSpatialLocation", + "type": "object", + "properties": { + "AsIngestedCoordinates": { + "description": "The original or 'as ingested' coordinates (Point, MultiPoint, LineString, MultiLineString, Polygon or MultiPolygon). The name 'AsIngestedCoordinates' was chosen to contrast it to 'OriginalCoordinates', which carries the uncertainty whether any coordinate operations took place before ingestion. In cases where the original CRS is different from the as-ingested CRS, the OperationsApplied can also contain the list of operations applied to the coordinate prior to ingestion. The data structure is similar to GeoJSON FeatureCollection, however in a CRS context explicitly defined within the AbstractAnyCrsFeatureCollection. The coordinate sequence follows GeoJSON standard, i.e. 'eastward/longitude', 'northward/latitude' {, 'upward/height' unless overridden by an explicit direction in the AsIngestedCoordinates.VerticalCoordinateReferenceSystemID}.", + "x-osdu-frame-of-reference": "CRS:", + "title": "As Ingested Coordinates", + "$ref": "#/definitions/opendes:wks:AbstractAnyCrsFeatureCollection:1.0.0" + }, + "SpatialParameterTypeID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-SpatialParameterType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "A type of spatial representation of an object, often general (e.g. an Outline, which could be applied to Field, Reservoir, Facility, etc.) or sometimes specific (e.g. Onshore Outline, State Offshore Outline, Federal Offshore Outline, 3 spatial representations that may be used by Countries).", + "x-osdu-relationship": [ + { + "EntityType": "SpatialParameterType", + "GroupType": "reference-data" + } + ], + "type": "string" + }, + "QuantitativeAccuracyBandID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-QuantitativeAccuracyBand:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "An approximate quantitative assessment of the quality of a location (accurate to > 500 m (i.e. not very accurate)), to < 1 m, etc.", + "x-osdu-relationship": [ + { + "EntityType": "QuantitativeAccuracyBand", + "GroupType": "reference-data" + } + ], + "type": "string" + }, + "CoordinateQualityCheckRemarks": { + "type": "array", + "description": "Freetext remarks on Quality Check.", + "items": { + "type": "string" + } + }, + "AppliedOperations": { + "description": "The audit trail of operations applied to the coordinates from the original state to the current state. The list may contain operations applied prior to ingestion as well as the operations applied to produce the Wgs84Coordinates. The text elements refer to ESRI style CRS and Transformation names, which may have to be translated to EPSG standard names.", + "title": "Operations Applied", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "conversion from ED_1950_UTM_Zone_31N to GCS_European_1950; 1 points converted", + "transformation GCS_European_1950 to GCS_WGS_1984 using ED_1950_To_WGS_1984_24; 1 points successfully transformed" + ] + }, + "QualitativeSpatialAccuracyTypeID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-QualitativeSpatialAccuracyType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "A qualitative description of the quality of a spatial location, e.g. unverifiable, not verified, basic validation.", + "x-osdu-relationship": [ + { + "EntityType": "QualitativeSpatialAccuracyType", + "GroupType": "reference-data" + } + ], + "type": "string" + }, + "CoordinateQualityCheckPerformedBy": { + "type": "string", + "description": "The user who performed the Quality Check." + }, + "SpatialLocationCoordinatesDate": { + "format": "date-time", + "description": "Date when coordinates were measured or retrieved.", + "x-osdu-frame-of-reference": "DateTime", + "type": "string" + }, + "CoordinateQualityCheckDateTime": { + "format": "date-time", + "description": "The date of the Quality Check.", + "x-osdu-frame-of-reference": "DateTime", + "type": "string" + }, + "Wgs84Coordinates": { + "title": "WGS 84 Coordinates", + "description": "The normalized coordinates (Point, MultiPoint, LineString, MultiLineString, Polygon or MultiPolygon) based on WGS 84 (EPSG:4326 for 2-dimensional coordinates, EPSG:4326 + EPSG:5714 (MSL) for 3-dimensional coordinates). This derived coordinate representation is intended for global discoverability only. The schema of this substructure is identical to the GeoJSON FeatureCollection https://geojson.org/schema/FeatureCollection.json. The coordinate sequence follows GeoJSON standard, i.e. longitude, latitude {, height}", + "$ref": "#/definitions/opendes:wks:AbstractFeatureCollection:1.0.0" + }, + "SpatialGeometryTypeID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-SpatialGeometryType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Indicates the expected look of the SpatialParameterType, e.g. Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon. The value constrains the type of geometries in the GeoJSON Wgs84Coordinates and AsIngestedCoordinates.", + "x-osdu-relationship": [ + { + "EntityType": "SpatialGeometryType", + "GroupType": "reference-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractSpatialLocation.1.0.0.json" + }, + "opendes:wks:AbstractGeoFieldContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoFieldContext:1.0.0", + "description": "A single, typed field entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", + "title": "AbstractGeoFieldContext", + "type": "object", + "properties": { + "FieldID": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-Field:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Reference to Field.", + "x-osdu-relationship": [ + { + "EntityType": "Field", + "GroupType": "master-data" + } + ], + "type": "string" + }, + "GeoTypeID": { + "const": "Field", + "description": "The fixed type 'Field' for this AbstractGeoFieldContext." + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoFieldContext.1.0.0.json" + }, + "opendes:wks:AbstractFeatureCollection:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractFeatureCollection:1.0.0", + "description": "GeoJSON feature collection as originally published in https://geojson.org/schema/FeatureCollection.json. Attention: the coordinate order is fixed: Longitude first, followed by Latitude, optionally height above MSL (EPSG:5714) as third coordinate.", + "title": "GeoJSON FeatureCollection", + "type": "object", + "required": [ + "type", + "features" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "FeatureCollection" + ] + }, + "features": { + "type": "array", + "items": { + "title": "GeoJSON Feature", + "type": "object", + "required": [ + "type", + "properties", + "geometry" + ], + "properties": { + "geometry": { + "oneOf": [ + { + "type": "null" + }, + { + "title": "GeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "type": { + "type": "string", + "enum": [ + "Point" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "LineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "Polygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON GeometryCollection", + "type": "object", + "required": [ + "type", + "geometries" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "GeometryCollection" + ] + }, + "geometries": { + "type": "array", + "items": { + "oneOf": [ + { + "title": "GeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "type": { + "type": "string", + "enum": [ + "Point" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "LineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "Polygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + ] + } + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + ] + }, + "type": { + "type": "string", + "enum": [ + "Feature" + ] + }, + "properties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object" + } + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractFeatureCollection:1.0.0.json" + }, + "opendes:wks:AbstractAccessControlList:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractAccessControlList:1.0.0", + "description": "The access control tags associated with this entity. This structure is included by the SystemProperties \"acl\", which is part of all OSDU records. Not extensible.", + "additionalProperties": false, + "title": "Access Control List", + "type": "object", + "properties": { + "viewers": { + "description": "The list of viewers to which this data record is accessible/visible/discoverable formatted as an email (core.common.model.storage.validation.ValidationDoc.EMAIL_REGEX).", + "title": "List of Viewers", + "type": "array", + "items": { + "pattern": "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$", + "type": "string" + } + }, + "owners": { + "description": "The list of owners of this data record formatted as an email (core.common.model.storage.validation.ValidationDoc.EMAIL_REGEX).", + "title": "List of Owners", + "type": "array", + "items": { + "pattern": "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$", + "type": "string" + } + } + }, + "required": [ + "owners", + "viewers" + ], + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractAccessControlList.1.0.0.json" + }, + "opendes:wks:AbstractGeoPlayContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoPlayContext:1.0.0", + "description": "A single, typed Play entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", + "x-osdu-review-status": "Accepted", + "title": "AbstractGeoPlayContext", + "type": "object", + "properties": { + "PlayID": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-Play:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Reference to the play.", + "x-osdu-relationship": [ + { + "EntityType": "Play", + "GroupType": "master-data" + } + ], + "type": "string" + }, + "GeoTypeID": { + "x-osdu-is-derived": { + "RelationshipPropertyName": "PlayID", + "TargetPropertyName": "PlayTypeID" + }, + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-PlayType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The PlayType reference of the Play (via PlayID) for application convenience.", + "x-osdu-relationship": [ + { + "EntityType": "PlayType", + "GroupType": "reference-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoPlayContext.1.0.0.json" + }, + "opendes:wks:AbstractLegalParentList:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractLegalParentList:1.0.0", + "description": "A list of entity IDs in the data ecosystem, which act as legal parents to the current entity. This structure is included by the SystemProperties \"ancestry\", which is part of all OSDU records. Not extensible.", + "additionalProperties": false, + "title": "Parent List", + "type": "object", + "properties": { + "parents": { + "description": "An array of none, one or many entity references in the data ecosystem, which identify the source of data in the legal sense. In contract to other relationships, the source record version is required. Example: the 'parents' will be queried when e.g. the subscription of source data services is terminated; access to the derivatives is also terminated.", + "title": "Parents", + "type": "array", + "items": { + "x-osdu-relationship": [], + "pattern": "^[\\w\\-\\.]+:[\\w\\-\\.]+:[\\w\\-\\.\\:\\%]+:[0-9]+$", + "type": "string" + }, + "example": [] + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractLegalParentList.1.0.0.json" + } + }, + "properties": { + "ancestry": { + "description": "The links to data, which constitute the inputs.", + "title": "Ancestry", + "$ref": "#/definitions/opendes:wks:AbstractLegalParentList:1.0.0" + }, + "data": { + "allOf": [ + { + "$ref": "#/definitions/opendes:wks:AbstractCommonResources:1.0.0" + }, + { + "$ref": "#/definitions/opendes:wks:AbstractMaster:1.0.0" + }, + { + "type": "object", + "properties": {} + }, + { + "type": "object", + "properties": { + "ExtensionProperties": { + "type": "object" + } + } + } + ] + }, + "kind": { + "pattern": "^[\\w\\-\\.]+:[\\w\\-\\.]+:[\\w\\-\\.]+:[0-9]+.[0-9]+.[0-9]+$", + "description": "The schema identification for the OSDU resource object following the pattern {Namespace}:{Source}:{Type}:{VersionMajor}.{VersionMinor}.{VersionPatch}. The versioning scheme follows the semantic versioning, https://semver.org/.", + "title": "Entity Kind", + "type": "string", + "example": "osdu:wks:master-data--Test:1.0.0" + }, + "acl": { + "description": "The access control tags associated with this entity.", + "title": "Access Control List", + "$ref": "#/definitions/opendes:wks:AbstractAccessControlList:1.0.0" + }, + "version": { + "format": "int64", + "description": "The version number of this OSDU resource; set by the framework.", + "title": "Version Number", + "type": "integer", + "example": 1562066009929332 + }, + "tags": { + "description": "A generic dictionary of string keys mapping to string value. Only strings are permitted as keys and values.", + "additionalProperties": { + "type": "string" + }, + "title": "Tag Dictionary", + "type": "object", + "example": { + "NameOfKey": "String value" + } + }, + "modifyUser": { + "description": "The user reference, which created this version of this resource object. Set by the System.", + "title": "Resource Object Version Creation User Reference", + "type": "string", + "example": "some-user@some-company-cloud.com" + }, + "modifyTime": { + "format": "date-time", + "description": "Timestamp of the time at which this version of the OSDU resource object was created. Set by the System. The value is a combined date-time string in ISO-8601 given in UTC.", + "title": "Resource Object Version Creation DateTime", + "type": "string", + "example": "2020-12-16T11:52:24.477Z" + }, + "createTime": { + "format": "date-time", + "description": "Timestamp of the time at which initial version of this OSDU resource object was created. Set by the System. The value is a combined date-time string in ISO-8601 given in UTC.", + "title": "Resource Object Creation DateTime", + "type": "string", + "example": "2020-12-16T11:46:20.163Z" + }, + "meta": { + "description": "The Frame of Reference meta data section linking the named properties to self-contained definitions.", + "title": "Frame of Reference Meta Data", + "type": "array", + "items": { + "$ref": "#/definitions/opendes:wks:AbstractMetaItem:1.0.0" + } + }, + "legal": { + "description": "The entity's legal tags and compliance status. The actual contents associated with the legal tags is managed by the Compliance Service.", + "title": "Legal Tags", + "$ref": "#/definitions/opendes:wks:AbstractLegalTags:1.0.0" + }, + "createUser": { + "description": "The user reference, which created the first version of this resource object. Set by the System.", + "title": "Resource Object Creation User Reference", + "type": "string", + "example": "some-user@some-company-cloud.com" + }, + "id": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-Test:[\\w\\-\\.\\:\\%]+$", + "description": "Previously called ResourceID or SRN which identifies this OSDU resource object without version.", + "title": "Entity ID", + "type": "string", + "example": "namespace:master-data--Test:ded98862-efe4-5517-a509-d99f4b941b20" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/master-data/Test.1.0.0.json" +} \ No newline at end of file diff --git a/indexer-core/src/test/resources/converter/new-definitions-format/colons-sample.json.res b/indexer-core/src/test/resources/converter/new-definitions-format/colons-sample.json.res new file mode 100644 index 0000000000000000000000000000000000000000..8f3ca4d7266d4f92177459314efe2445f6a25949 --- /dev/null +++ b/indexer-core/src/test/resources/converter/new-definitions-format/colons-sample.json.res @@ -0,0 +1,77 @@ +{ + "kind": "osdu:osdu:Wellbore:1.0.0", + "schema": [ + { + "path": "ResourceHomeRegionID", + "kind": "string" + }, + { + "path": "ResourceHostRegionIDs", + "kind": "[]string" + }, + { + "path": "ResourceLifecycleStatus", + "kind": "string" + }, + { + "path": "ResourceSecurityClassification", + "kind": "string" + }, + { + "path": "ResourceCurationStatus", + "kind": "string" + }, + { + "path": "ExistenceKind", + "kind": "string" + }, + { + "path": "Source", + "kind": "string" + }, + { + "path": "SpatialLocation.SpatialParameterTypeID", + "kind": "string" + }, + { + "path": "SpatialLocation.QuantitativeAccuracyBandID", + "kind": "string" + }, + { + "path": "SpatialLocation.CoordinateQualityCheckRemarks", + "kind": "[]string" + }, + { + "path": "SpatialLocation.AppliedOperations", + "kind": "[]string" + }, + { + "path": "SpatialLocation.QualitativeSpatialAccuracyTypeID", + "kind": "string" + }, + { + "path": "SpatialLocation.CoordinateQualityCheckPerformedBy", + "kind": "string" + }, + { + "path": "SpatialLocation.SpatialLocationCoordinatesDate", + "kind": "datetime" + }, + { + "path": "SpatialLocation.CoordinateQualityCheckDateTime", + "kind": "datetime" + }, + { + "path": "SpatialLocation.Wgs84Coordinates", + "kind": "core:dl:geoshape:1.0.0" + }, + { + "path": "SpatialLocation.SpatialGeometryTypeID", + "kind": "string" + }, + { + "path": "VersionCreationReason", + "kind": "string" + } + ] +} \ No newline at end of file diff --git a/indexer-core/src/test/resources/converter/tags/allOf/allOf-inside-allOf.json b/indexer-core/src/test/resources/converter/tags/allOf/allOf-inside-allOf.json index 8ba3af2519d300e8dfcbcc17f77f8cf12bfb3bb0..950a7ed62ef135be3b6518de449bf78e60eea974 100644 --- a/indexer-core/src/test/resources/converter/tags/allOf/allOf-inside-allOf.json +++ b/indexer-core/src/test/resources/converter/tags/allOf/allOf-inside-allOf.json @@ -1,27 +1,27 @@ { "definitions": { - "wellboreData1": { + "opendes:wks:wellboreData1:1.0.0": { "properties": { "prop1": { "type": "string" } } }, - "wellboreData2": { + "opendes:wks:wellboreData2:1.0.0": { "properties": { "prop2": { "type": "string" } } }, - "wellboreData3": { + "opendes:wks:wellboreData3:1.0.0": { "properties": { "prop3": { "type": "string" } } }, - "wellboreData4": { + "opendes:wks:wellboreData4:1.0.0": { "properties": { "prop4": { "type": "string" @@ -35,18 +35,18 @@ { "allOf": [ { - "$ref": "#/definitions/wellboreData1" + "$ref": "#/definitions/opendes:wks:wellboreData1:1.0.0" }, { - "$ref": "#/definitions/wellboreData2" + "$ref": "#/definitions/opendes:wks:wellboreData2:1.0.0" } ] }, { - "$ref": "#/definitions/wellboreData3" + "$ref": "#/definitions/opendes:wks:wellboreData3:1.0.0" }, { - "$ref": "#/definitions/wellboreData4" + "$ref": "#/definitions/opendes:wks:wellboreData4:1.0.0" } ] } diff --git a/indexer-core/src/test/resources/converter/tags/allOf/allOf-inside-property.json b/indexer-core/src/test/resources/converter/tags/allOf/allOf-inside-property.json index 1f2d761d21a1501dbf05d3ac59c20f511238f16a..ec3efcd3cefad7952c7b2a3beedcd19ef2ef1d08 100644 --- a/indexer-core/src/test/resources/converter/tags/allOf/allOf-inside-property.json +++ b/indexer-core/src/test/resources/converter/tags/allOf/allOf-inside-property.json @@ -1,6 +1,6 @@ { "definitions": { - "def1": { + "opendes:wks:def1:1.0.0": { "properties": { "prop1": { "type": "string" @@ -14,7 +14,7 @@ "FacilityName": { "allOf": [ { - "$ref": "#/definitions/def1" + "$ref": "#/definitions/opendes:wks:def1:1.0.0" }, { "properties": { diff --git a/indexer-core/src/test/resources/converter/tags/allOf/indefinitions.json b/indexer-core/src/test/resources/converter/tags/allOf/indefinitions.json index 0064dd0ae4bc8ee01c7dff273f986a762f05ead7..db27b0b957d00516a53dbca08b5755c71c05b3fe 100644 --- a/indexer-core/src/test/resources/converter/tags/allOf/indefinitions.json +++ b/indexer-core/src/test/resources/converter/tags/allOf/indefinitions.json @@ -1,16 +1,16 @@ { "definitions": { - "wellboreData1": { + "opendes:wks:wellboreData1:1.0.0": { "properties": { "prop1": { "type": "string" } } }, - "wellboreData2": { + "opendes:wks:wellboreData2:1.0.0": { "allOf": [ { - "$ref": "#/definitions/wellboreData1" + "$ref": "#/definitions/opendes:wks:wellboreData1:1.0.0" } ] } @@ -20,7 +20,7 @@ "type": "object", "properties": { "Field": { - "$ref": "#/definitions/wellboreData2" + "$ref": "#/definitions/opendes:wks:wellboreData2:1.0.0" } } } diff --git a/indexer-core/src/test/resources/converter/tags/anyOf/indefinitions.json b/indexer-core/src/test/resources/converter/tags/anyOf/indefinitions.json index 4733286c10bd2d081ae85fa44ee22d499a86908d..ab87712afe11ccbd52120cbc0abb89b1a26210e1 100644 --- a/indexer-core/src/test/resources/converter/tags/anyOf/indefinitions.json +++ b/indexer-core/src/test/resources/converter/tags/anyOf/indefinitions.json @@ -1,16 +1,16 @@ { "definitions": { - "wellboreData1": { + "opendes:wks:wellboreData1:1.0.0": { "properties": { "prop1": { "type": "string" } } }, - "wellboreData2": { + "opendes:wks:wellboreData2:1.0.0": { "anyOf": [ { - "$ref": "#/definitions/wellboreData1" + "$ref": "#/definitions/opendes:wks:wellboreData1:1.0.0" } ] } @@ -20,7 +20,7 @@ "type": "object", "properties": { "Field": { - "$ref": "#/definitions/wellboreData2" + "$ref": "#/definitions/opendes:wks:wellboreData2:1.0.0" } } } diff --git a/indexer-core/src/test/resources/converter/tags/mixAllAnyOneOf/mix.json b/indexer-core/src/test/resources/converter/tags/mixAllAnyOneOf/mix.json index 2eb9de93a9911ad6407366a362fa0604219f7361..c94d1649bf33ddf0c9a8929f9f43f8496056a628 100644 --- a/indexer-core/src/test/resources/converter/tags/mixAllAnyOneOf/mix.json +++ b/indexer-core/src/test/resources/converter/tags/mixAllAnyOneOf/mix.json @@ -1,27 +1,27 @@ { "definitions": { - "wellboreData1": { + "opendes:wks:wellboreData1:1.0.0": { "properties": { "prop1": { "type": "string" } } }, - "wellboreData2": { + "opendes:wks:wellboreData2:1.0.0": { "properties": { "prop2": { "type": "string" } } }, - "wellboreData3": { + "opendes:wks:wellboreData3:1.0.0": { "properties": { "prop3": { "type": "string" } } }, - "wellboreData4": { + "opendes:wks:wellboreData4:1.0.0": { "properties": { "prop4": { "type": "string" @@ -35,19 +35,19 @@ { "anyOf": [ { - "$ref": "#/definitions/wellboreData1" + "$ref": "#/definitions/opendes:wks:wellboreData1:1.0.0" } ], "oneOf": [ { - "$ref": "#/definitions/wellboreData2" + "$ref": "#/definitions/opendes:wks:wellboreData2:1.0.0" } ] }, { - "$ref": "#/definitions/wellboreData3" + "$ref": "#/definitions/opendes:wks:wellboreData3:1.0.0" }, { - "$ref": "#/definitions/wellboreData4" + "$ref": "#/definitions/opendes:wks:wellboreData4:1.0.0" } ] } diff --git a/indexer-core/src/test/resources/converter/tags/oneOf/indefinitions.json b/indexer-core/src/test/resources/converter/tags/oneOf/indefinitions.json index 4733286c10bd2d081ae85fa44ee22d499a86908d..ab87712afe11ccbd52120cbc0abb89b1a26210e1 100644 --- a/indexer-core/src/test/resources/converter/tags/oneOf/indefinitions.json +++ b/indexer-core/src/test/resources/converter/tags/oneOf/indefinitions.json @@ -1,16 +1,16 @@ { "definitions": { - "wellboreData1": { + "opendes:wks:wellboreData1:1.0.0": { "properties": { "prop1": { "type": "string" } } }, - "wellboreData2": { + "opendes:wks:wellboreData2:1.0.0": { "anyOf": [ { - "$ref": "#/definitions/wellboreData1" + "$ref": "#/definitions/opendes:wks:wellboreData1:1.0.0" } ] } @@ -20,7 +20,7 @@ "type": "object", "properties": { "Field": { - "$ref": "#/definitions/wellboreData2" + "$ref": "#/definitions/opendes:wks:wellboreData2:1.0.0" } } } diff --git a/indexer-core/src/test/resources/converter/wks/slb_wke_wellbore.json b/indexer-core/src/test/resources/converter/wks/slb_wke_wellbore.json index 4750faf2cd40de8a375ee67350af2f6eea1fe295..32ca4d6d3bee19fcfb397abfb292d3522964fdb3 100644 --- a/indexer-core/src/test/resources/converter/wks/slb_wke_wellbore.json +++ b/indexer-core/src/test/resources/converter/wks/slb_wke_wellbore.json @@ -3,7 +3,7 @@ "$license": "Copyright 2017-2020, Schlumberger\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n", "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { - "core_dl_geopoint": { + "opendes:wks:core_dl_geopoint:1.0.0": { "description": "A 2D point location in latitude and longitude referenced to WGS 84 if not specified otherwise.", "properties": { "latitude": { @@ -28,7 +28,7 @@ "title": "2D Map Location", "type": "object" }, - "geoJsonFeature": { + "opendes:wks:geoJsonFeature:1.0.0": { "properties": { "bbox": { "items": { @@ -40,27 +40,27 @@ "geometry": { "oneOf": [ { - "$ref": "#/definitions/geoJsonPoint", + "$ref": "#/definitions/opendes:wks:geoJsonPoint:1.0.0", "title": "GeoJSON Point" }, { - "$ref": "#/definitions/geoJsonMultiPoint", + "$ref": "#/definitions/opendes:wks:geoJsonMultiPoint:1.0.0", "title": "GeoJSON MultiPoint" }, { - "$ref": "#/definitions/geoJsonLineString", + "$ref": "#/definitions/opendes:wks:geoJsonLineString:1.0.0", "title": "GeoJSON LineString" }, { - "$ref": "#/definitions/geoJsonMultiLineString", + "$ref": "#/definitions/opendes:wks:geoJsonMultiLineString:1.0.0", "title": "GeoJSON MultiLineString" }, { - "$ref": "#/definitions/polygon", + "$ref": "#/definitions/opendes:wks:polygon:1.0.0", "title": "GeoJSON Polygon" }, { - "$ref": "#/definitions/geoJsonMultiPolygon", + "$ref": "#/definitions/opendes:wks:geoJsonMultiPolygon:1.0.0", "title": "GeoJSON MultiPolygon" }, { @@ -76,27 +76,27 @@ "items": { "oneOf": [ { - "$ref": "#/definitions/geoJsonPoint", + "$ref": "#/definitions/opendes:wks:geoJsonPoint:1.0.0", "title": "GeoJSON Point" }, { - "$ref": "#/definitions/geoJsonMultiPoint", + "$ref": "#/definitions/opendes:wks:geoJsonMultiPoint:1.0.0", "title": "GeoJSON MultiPoint" }, { - "$ref": "#/definitions/geoJsonLineString", + "$ref": "#/definitions/opendes:wks:geoJsonLineString:1.0.0", "title": "GeoJSON LineString" }, { - "$ref": "#/definitions/geoJsonMultiLineString", + "$ref": "#/definitions/opendes:wks:geoJsonMultiLineString:1.0.0", "title": "GeoJSON MultiLineString" }, { - "$ref": "#/definitions/polygon", + "$ref": "#/definitions/opendes:wks:polygon:1.0.0", "title": "GeoJSON Polygon" }, { - "$ref": "#/definitions/geoJsonMultiPolygon", + "$ref": "#/definitions/opendes:wks:geoJsonMultiPolygon:1.0.0", "title": "GeoJSON MultiPolygon" } ] @@ -144,7 +144,7 @@ "title": "GeoJSON Feature", "type": "object" }, - "geoJsonFeatureCollection": { + "opendes:wks:geoJsonFeatureCollection:1.0.0": { "properties": { "bbox": { "items": { @@ -155,7 +155,7 @@ }, "features": { "items": { - "$ref": "#/definitions/geoJsonFeature", + "$ref": "#/definitions/opendes:wks:geoJsonFeature:1.0.0", "title": "GeoJSON Feature" }, "type": "array" @@ -174,7 +174,7 @@ "title": "GeoJSON FeatureCollection", "type": "object" }, - "geoJsonLineString": { + "opendes:wks:geoJsonLineString:1.0.0": { "description": "GeoJSON LineString as defined in http://geojson.org/schema/LineString.json.", "properties": { "bbox": { @@ -209,7 +209,7 @@ "title": "GeoJSON LineString", "type": "object" }, - "geoJsonMultiLineString": { + "opendes:wks:geoJsonMultiLineString:1.0.0": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { "bbox": { @@ -247,7 +247,7 @@ "title": "GeoJSON MultiLineString", "type": "object" }, - "geoJsonMultiPoint": { + "opendes:wks:geoJsonMultiPoint:1.0.0": { "properties": { "bbox": { "items": { @@ -280,7 +280,7 @@ "title": "GeoJSON Point", "type": "object" }, - "geoJsonMultiPolygon": { + "opendes:wks:geoJsonMultiPolygon:1.0.0": { "description": "GeoJSON MultiPolygon derived from http://geojson.org/schema/MultiPolygon.json", "properties": { "bbox": { @@ -323,7 +323,7 @@ "title": "MultiPolygon", "type": "object" }, - "geoJsonPoint": { + "opendes:wks:geoJsonPoint:1.0.0": { "properties": { "bbox": { "items": { @@ -353,7 +353,7 @@ "title": "GeoJSON Point", "type": "object" }, - "geographicPosition": { + "opendes:wks:geographicPosition:1.0.0": { "description": "A position in the native geographic CRS (latitude and longitude) combined with an elevation from mean seal level (MSL)", "properties": { "crsKey": { @@ -362,7 +362,7 @@ "type": "string" }, "elevationFromMsl": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "Elevation from Mean Seal Level, downwards negative. The unit definition is found via 'elevationFromMsl.unitKey' in 'frameOfReference.units' dictionary.", "title": "Elevation from MSL" }, @@ -386,7 +386,7 @@ "title": "Geographic Position", "type": "object" }, - "legal": { + "opendes:wks:legal:1.0.0": { "description": "Legal meta data like legal tags, relevant other countries, legal status.", "properties": { "legaltags": { @@ -414,7 +414,7 @@ "title": "Legal Meta Data", "type": "object" }, - "linkList": { + "opendes:wks:linkList:1.0.0": { "additionalProperties": { "description": "An array of one or more entity references in the data lake.", "items": { @@ -427,7 +427,7 @@ "title": "Link List", "type": "object" }, - "metaItem": { + "opendes:wks:metaItem:1.0.0": { "description": "A meta data item, which allows the association of named properties or property values to a Unit/Measurement/CRS/Azimuth/Time context.", "properties": { "kind": { @@ -496,7 +496,7 @@ "title": "Frame of Reference Meta Data Item", "type": "object" }, - "plssLocation": { + "opendes:wks:plssLocation:1.0.0": { "$id": "definitions/plssLocation", "description": "A location described by the Public Land Survey System (United States)", "properties": { @@ -542,7 +542,7 @@ "title": "US PLSS Location", "type": "object" }, - "point3dNonGeoJson": { + "opendes:wks:point3dNonGeoJson:1.0.0": { "description": "A 3-dimensional point with a CRS key, which is further described in 'frameOfReference.crs' and a unitKey for the z or 3rd coordinate; the unit key is further described in 'frameOfReference.units'.", "properties": { "coordinates": { @@ -574,7 +574,7 @@ "title": "3D Point with CRS/Unit key", "type": "object" }, - "polygon": { + "opendes:wks:polygon:1.0.0": { "$schema": "http://json-schema.org/draft-07/schema#", "description": "GeoJSON Polygon derived from http://geojson.org/schema/Polygon.json", "properties": { @@ -613,7 +613,7 @@ "title": "GeoJSON Polygon", "type": "object" }, - "projectedPosition": { + "opendes:wks:projectedPosition:1.0.0": { "description": "A position in the native CRS in Cartesian coordinates combined with an elevation from mean seal level (MSL)", "properties": { "crsKey": { @@ -622,7 +622,7 @@ "type": "string" }, "elevationFromMsl": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "Elevation from Mean Seal Level, downwards negative. The unit definition is found via 'elevationFromMsl.unitKey' in 'frameOfReference.units' dictionary.", "title": "Elevation from MSL" }, @@ -646,23 +646,23 @@ "title": "Projected Position", "type": "object" }, - "relationships": { + "opendes:wks:relationships:1.0.0": { "description": "All relationships from this entity.", "properties": { "definitiveTimeDepthRelation": { - "$ref": "#/definitions/toOneRelationship", + "$ref": "#/definitions/opendes:wks:toOneRelationship:1.0.0", "description": "The definitive tome-depth relation providing the MD to seismic travel-time transformation.", "title": "Definitive Time-Depth Relation", "x-slb-targetEntity": "timeDepthRelation_logSet" }, "definitiveTrajectory": { - "$ref": "#/definitions/toOneRelationship", + "$ref": "#/definitions/opendes:wks:toOneRelationship:1.0.0", "description": "The definitive trajectory providing the MD to 3D space transformation.", "title": "Definitive Trajectory", "x-slb-targetEntity": "trajectory" }, "tieInWellbore": { - "$ref": "#/definitions/toOneRelationship", + "$ref": "#/definitions/opendes:wks:toOneRelationship:1.0.0", "description": "The tie-in wellbore if this wellbore is a side-track.", "title": "Tie-in Wellbore", "x-slb-aliasProperties": [ @@ -672,7 +672,7 @@ "x-slb-targetEntity": "wellbore" }, "well": { - "$ref": "#/definitions/toOneRelationship", + "$ref": "#/definitions/opendes:wks:toOneRelationship:1.0.0", "description": "The well to which this wellbore belongs.", "title": "Well", "x-slb-aliasProperties": [ @@ -685,11 +685,11 @@ "title": "Relationships", "type": "object" }, - "simpleElevationReference": { + "opendes:wks:simpleElevationReference:1.0.0": { "description": "The entity's elevation reference, the elevation above MSL where vertical property is 0. Examples: MD==0, Elevation_Depth==0, TVD==0.", "properties": { "elevationFromMsl": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "The elevation above mean sea level (MSL), at which the vertical origin is 0.0. The 'unitKey' is further defined in 'frameOfReference.units'.", "example": 123.45, "title": "Elevation from MSL", @@ -713,7 +713,7 @@ "title": "Simple Elevation Reference", "type": "object" }, - "tagDictionary": { + "opendes:wks:tagDictionary:1.0.0": { "additionalProperties": { "description": "An array of one or more tag items, e.g. access control list tags, legal tags, etc.", "items": { @@ -726,7 +726,7 @@ "title": "Tag Dictionary", "type": "object" }, - "toManyRelationship": { + "opendes:wks:toManyRelationship:1.0.0": { "description": "A relationship from this entity to many other entities either by natural key (name) or explicit id, optionally classified by confidence level.", "properties": { "confidences": { @@ -765,7 +765,7 @@ } } }, - "toOneRelationship": { + "opendes:wks:toOneRelationship:1.0.0": { "description": "A relationship from this entity to one other entity either by natural key (name) or id, optionally classified by confidence level", "properties": { "confidence": { @@ -797,7 +797,7 @@ "title": "To One Relationship", "type": "object" }, - "valueArrayWithUnit": { + "opendes:wks:valueArrayWithUnit:1.0.0": { "description": "Array of values associated with unit context. The 'unitKey' can be looked up in the 'frameOfReference.units'.", "properties": { "unitKey": { @@ -826,7 +826,7 @@ "title": "Values with unitKey", "type": "object" }, - "valueWithUnit": { + "opendes:wks:valueWithUnit:1.0.0": { "description": "Number value associated with unit context. The 'unitKey' can be looked up in the root property meta[] array.", "properties": { "unitKey": { @@ -849,12 +849,12 @@ "title": "Value with unitKey", "type": "object" }, - "wellboreData": { + "opendes:wks:wellboreData:1.0.0": { "$id": "definitions/wellboreData", "description": "The domain specific data container for a wellbore.", "properties": { "airGap": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "The gap between water surface and offshore drilling platform.", "example": [ 11, @@ -911,7 +911,7 @@ "type": "string" }, "drillingDaysTarget": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "Target days for drilling wellbore.", "example": [ 12.5, @@ -924,7 +924,7 @@ "x-slb-measurement": "Time" }, "elevationReference": { - "$ref": "#/definitions/simpleElevationReference", + "$ref": "#/definitions/opendes:wks:simpleElevationReference:1.0.0", "description": "The wellbore's elevation reference from mean sea level (MSL), positive above MSL. This is where MD == 0 and TVD == 0", "title": "Elevation Reference", "type": "object" @@ -982,7 +982,7 @@ ] }, "kickOffMd": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "The kick-off point in measured depth (MD); for the main well the kickOffMd is set to 0.", "example": [ 6543.2, @@ -995,7 +995,7 @@ "x-slb-measurement": "Standard_Depth_Index" }, "kickOffTvd": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "Kickoff true vertical depth of the wellbore; for the main wellbore the kickOffMd is set to 0.", "example": [ 6543.2, @@ -1008,7 +1008,7 @@ "x-slb-measurement": "Standard_Depth_Index" }, "locationWGS84": { - "$ref": "#/definitions/geoJsonFeatureCollection", + "$ref": "#/definitions/opendes:wks:geoJsonFeatureCollection:1.0.0", "description": "A 2D GeoJSON FeatureCollection defining wellbore location or trajectory in WGS 84 CRS.", "title": "Wellbore Shape WGS 84", "type": "object" @@ -1045,7 +1045,7 @@ "type": "string" }, "plssLocation": { - "$ref": "#/definitions/plssLocation", + "$ref": "#/definitions/opendes:wks:plssLocation:1.0.0", "description": "A location described by the Public Land Survey System (United States)", "title": "US PLSS Location", "type": "object" @@ -1059,7 +1059,7 @@ "type": "string" }, "relationships": { - "$ref": "#/definitions/relationships", + "$ref": "#/definitions/opendes:wks:relationships:1.0.0", "description": "The related entities.", "title": "Relationships" }, @@ -1100,7 +1100,7 @@ "type": "string" }, "totalDepthMd": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "The measured depth of the borehole. If status is plugged, indicates the maximum depth reached before plugging. It is recommended that this value be updated about every 10 minutes by an assigned raw data provider at a site.", "example": [ 13200, @@ -1114,7 +1114,7 @@ "x-slb-measurement": "Standard_Depth_Index" }, "totalDepthMdDriller": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "The total depth along the wellbore as reported by the drilling contractor from 'elevationReference'. The unit definition is found via the property's unitKey' in 'frameOfReference.units' dictionary..", "example": [ 13200.23, @@ -1127,7 +1127,7 @@ "x-slb-measurement": "Standard_Depth_Index" }, "totalDepthMdPlanned": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "Planned measured depth for the wellbore total depth.", "example": [ 13200, @@ -1140,7 +1140,7 @@ "x-slb-measurement": "Standard_Depth_Index" }, "totalDepthMdSubSeaPlanned": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "Planned measured for the wellbore total depth - with respect to seabed.", "example": [ 13100, @@ -1153,7 +1153,7 @@ "x-slb-measurement": "Standard_Depth_Index" }, "totalDepthProjectedMd": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "The projected total measured depth of the borehole. This property is questionable as there is not precise documentation available.", "example": [ 13215, @@ -1163,7 +1163,7 @@ "x-slb-measurement": "Standard_Depth_Index" }, "totalDepthTvd": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "The true vertical depth of the borehole. If status is plugged, indicates the maximum depth reached before plugging. It is recommended that this value be updated about every 10 minutes by an assigned raw data provider at a site.", "example": [ 12200.23, @@ -1176,7 +1176,7 @@ "x-slb-measurement": "Standard_Depth_Index" }, "totalDepthTvdDriller": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "The total depth true vertical as reported by the drilling contractor from 'elevationReference', Downwards increasing. The unit definition is found via the property's unitKey' in 'frameOfReference.units' dictionary.", "example": [ 12200.23, @@ -1189,7 +1189,7 @@ "x-slb-measurement": "Standard_Depth_Index" }, "totalDepthTvdPlanned": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "Planned true vertical depth for the wellbore total depth.", "example": [ 12200.23, @@ -1202,7 +1202,7 @@ "x-slb-measurement": "Standard_Depth_Index" }, "totalDepthTvdSubSeaPlanned": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "Planned true vertical depth for the wellbore total depth - with respect to seabed.", "example": [ 12100.23, @@ -1229,25 +1229,25 @@ ] }, "wellHeadElevation": { - "$ref": "#/definitions/valueWithUnit", + "$ref": "#/definitions/opendes:wks:valueWithUnit:1.0.0", "description": "The wellbore's vertical position is an elevation from mean sea level (MSL), positive above MSL.", "title": "Well Head Elevation", "x-slb-measurement": "Standard_Depth_Index" }, "wellHeadGeographic": { - "$ref": "#/definitions/geographicPosition", + "$ref": "#/definitions/opendes:wks:geographicPosition:1.0.0", "description": "The wellbore's well head position in the native, geographic CRS; vertical position is an elevation from mean sea level (MSL), positive above MSL.", "title": "Well Head Position, Geographic", "type": "object" }, "wellHeadProjected": { - "$ref": "#/definitions/projectedPosition", + "$ref": "#/definitions/opendes:wks:projectedPosition:1.0.0", "description": "The wellbore's well head position in the native, projected CRS; vertical position is an elevation from mean sea level (MSL), positive above MSL.", "title": "Well Head Position, Projected", "type": "object" }, "wellHeadWgs84": { - "$ref": "#/definitions/core_dl_geopoint", + "$ref": "#/definitions/opendes:wks:core_dl_geopoint:1.0.0", "description": "The wellbore's position in WGS 84 latitude and longitude.", "format": "core:dl:geopoint:1.0.0", "title": "WGS 84 Position", @@ -1366,17 +1366,17 @@ "description": "The well-known wellbore schema. Used to capture the general information about a wellbore. This information is sometimes called a \"wellbore header\". A wellbore represents the path from surface to a unique bottomhole location. The wellbore object is uniquely identified within the context of one well object.", "properties": { "acl": { - "$ref": "#/definitions/tagDictionary", + "$ref": "#/definitions/opendes:wks:tagDictionary:1.0.0", "description": "The access control tags associated with this entity.", "title": "Access Control List" }, "ancestry": { - "$ref": "#/definitions/linkList", + "$ref": "#/definitions/opendes:wks:linkList:1.0.0", "description": "The links to data, which constitute the inputs.", "title": "Ancestry" }, "data": { - "$ref": "#/definitions/wellboreData", + "$ref": "#/definitions/opendes:wks:wellboreData:1.0.0", "description": "Wellbore data container", "title": "Wellbore Data" }, @@ -1392,14 +1392,14 @@ "type": "string" }, "legal": { - "$ref": "#/definitions/legal", + "$ref": "#/definitions/opendes:wks:legal:1.0.0", "description": "The geological interpretation's legal tags", "title": "Legal Tags" }, "meta": { "description": "The meta data section linking the 'unitKey', 'crsKey' to self-contained definitions (persistableReference)", "items": { - "$ref": "#/definitions/metaItem" + "$ref": "#/definitions/opendes:wks:metaItem:1.0.0" }, "title": "Frame of Reference Meta Data", "type": "array" diff --git a/pom.xml b/pom.xml index d24aad221589fd26fd867d4c1b9d8bd03f4d2c24..51f7584b12ad62b290706011cc4e8eb3c4e3a7c0 100644 --- a/pom.xml +++ b/pom.xml @@ -12,14 +12,14 @@ <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> <packaging>pom</packaging> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <description>Indexer Service</description> <properties> <java.version>1.8</java.version> <springfox-version>2.7.0</springfox-version> <spring-cloud.version>Greenwich.SR2</spring-cloud.version> - <os-core-common.version>0.3.19</os-core-common.version> + <os-core-common.version>0.6.9</os-core-common.version> <snakeyaml.version>1.26</snakeyaml.version> <hibernate-validator.version>6.1.5.Final</hibernate-validator.version> <jackson.version>2.11.2</jackson.version> diff --git a/provider/indexer-aws/pom.xml b/provider/indexer-aws/pom.xml index 1ee9eb488b579e264cb5916c96038282b1c26837..7fad557f0e8324b8df8cf15a3fd39878a40d0299 100644 --- a/provider/indexer-aws/pom.xml +++ b/provider/indexer-aws/pom.xml @@ -18,7 +18,7 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> @@ -26,7 +26,7 @@ <artifactId>indexer-aws</artifactId> <description>Storage service on AWS</description> <packaging>jar</packaging> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <properties> <aws.version>1.11.637</aws.version> @@ -43,7 +43,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-core</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu.core.aws</groupId> diff --git a/provider/indexer-aws/src/main/java/org/opengroup/osdu/indexer/aws/util/IndexerQueueTaskBuilderAws.java b/provider/indexer-aws/src/main/java/org/opengroup/osdu/indexer/aws/util/IndexerQueueTaskBuilderAws.java index b93d3c94144d859cdf25cde6ff4e1cfcd7ff9358..cb47d53cd17fce4056d18d82a4371f8b1fe2d204 100644 --- a/provider/indexer-aws/src/main/java/org/opengroup/osdu/indexer/aws/util/IndexerQueueTaskBuilderAws.java +++ b/provider/indexer-aws/src/main/java/org/opengroup/osdu/indexer/aws/util/IndexerQueueTaskBuilderAws.java @@ -79,15 +79,38 @@ public class IndexerQueueTaskBuilderAws extends IndexerQueueTaskBuilder { } @Override public void createReIndexTask(String payload,DpsHeaders headers) { - this.createTask(payload, headers); + Map<String, MessageAttributeValue> messageAttributes = new HashMap<>(); + messageAttributes.put(DpsHeaders.ACCOUNT_ID, new MessageAttributeValue() + .withDataType("String") + .withStringValue(headers.getPartitionIdWithFallbackToAccountId())); + messageAttributes.put(DpsHeaders.DATA_PARTITION_ID, new MessageAttributeValue() + .withDataType("String") + .withStringValue(headers.getPartitionIdWithFallbackToAccountId())); + headers.addCorrelationIdIfMissing(); + messageAttributes.put(DpsHeaders.CORRELATION_ID, new MessageAttributeValue() + .withDataType("String") + .withStringValue(headers.getCorrelationId())); + messageAttributes.put(DpsHeaders.USER_EMAIL, new MessageAttributeValue() + .withDataType("String") + .withStringValue(headers.getUserEmail())); + messageAttributes.put(DpsHeaders.AUTHORIZATION, new MessageAttributeValue() + .withDataType("String") + .withStringValue(headers.getAuthorization())); + messageAttributes.put("ReIndexCursor", new MessageAttributeValue() + .withDataType("String") + .withStringValue("True")); + SendMessageRequest sendMessageRequest = new SendMessageRequest() + .withQueueUrl(storageQueue) + .withMessageBody(payload) + .withMessageAttributes(messageAttributes); + sqsClient.sendMessage(sendMessageRequest); } @Override public void createReIndexTask(String payload, Long countDownMillis, DpsHeaders headers){ - this.createTask(payload, headers); + this.createReIndexTask(payload, headers); } private void createTask(String payload, DpsHeaders headers) { - Map<String, MessageAttributeValue> messageAttributes = new HashMap<>(); messageAttributes.put(DpsHeaders.ACCOUNT_ID, new MessageAttributeValue() .withDataType("String") diff --git a/provider/indexer-azure/pom.xml b/provider/indexer-azure/pom.xml index f67a7fcbb3ab51a12eafb5120b8a56ffb4e64a16..88c81b927e5cce9085b9dd747731fc3d93630845 100644 --- a/provider/indexer-azure/pom.xml +++ b/provider/indexer-azure/pom.xml @@ -21,12 +21,12 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <artifactId>indexer-azure</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <name>indexer-azure</name> <description>Indexer Service Azure</description> <packaging>jar</packaging> @@ -39,10 +39,9 @@ <azure.appservice.subscription /> <log4j.version>2.11.2</log4j.version> <nimbus-jose-jwt.version>8.2</nimbus-jose-jwt.version> - <indexer-core.version>0.6.0-SNAPSHOT</indexer-core.version> + <indexer-core.version>0.8.0-SNAPSHOT</indexer-core.version> <spring-security-jwt.version>1.1.1.RELEASE</spring-security-jwt.version> - <osdu.corelibazure.version>0.0.42</osdu.corelibazure.version> - <osdu.oscorecommon.version>0.3.12</osdu.oscorecommon.version> + <osdu.corelibazure.version>0.6.2</osdu.corelibazure.version> <reactor-netty.version>0.9.12.RELEASE</reactor-netty.version> <java-jwt.version>3.8.1</java-jwt.version> <powermock.version>2.0.2</powermock.version> @@ -169,11 +168,6 @@ <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> </dependency> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>os-core-common</artifactId> - <version>${osdu.oscorecommon.version}</version> - </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>core-lib-azure</artifactId> diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/IndexerAzureApplication.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/IndexerAzureApplication.java index 51886b1357c66e14699d82955c757203da00eba0..f0ed79107e68a6d71bb98296734c237de5a62c4a 100644 --- a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/IndexerAzureApplication.java +++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/IndexerAzureApplication.java @@ -18,12 +18,14 @@ import org.opengroup.osdu.indexer.IndexerApplication; import org.opengroup.osdu.indexer.ServerletInitializer; import org.opengroup.osdu.indexer.service.ElasticSettingServiceImpl; import org.springframework.boot.SpringApplication; +import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.FilterType; -@SpringBootApplication +@SpringBootApplication(exclude = { SecurityAutoConfiguration.class, ManagementWebSecurityAutoConfiguration.class }) @ComponentScan( basePackages = {"org.opengroup.osdu"}, excludeFilters = { diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/config/AzureBootstrapConfig.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/config/AzureBootstrapConfig.java index 570b932a29f49f8ba849488ed55d9e2f61d440ce..50184634c1f45e4990658b1a8ad0499e43f1ef6e 100644 --- a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/config/AzureBootstrapConfig.java +++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/config/AzureBootstrapConfig.java @@ -19,6 +19,8 @@ import org.opengroup.osdu.azure.KeyVaultFacade; import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig; import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory; import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory; +import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Component; @@ -34,18 +36,15 @@ public class AzureBootstrapConfig { @Value("${azure.servicebus.topic-name}") private String serviceBusTopicName; + @Value("${azure.servicebus.reindex.topic-name}") + private String serviceBusReindexTopicName; + @Value("${ELASTIC_CACHE_EXPIRATION}") private Integer elasticCacheExpiration; @Value("${MAX_CACHE_VALUE_SIZE}") private Integer maxCacheValueSize; - @Value("${AUTHORIZE_API_KEY}") - private String entitlementsAPIKey; - - @Value("${AUTHORIZE_API}") - private String entitlementsAPIEndpoint; - @Bean @Named("KEY_VAULT_URL") public String getKeyVaultURL() { @@ -58,6 +57,12 @@ public class AzureBootstrapConfig { return serviceBusTopicName; } + @Bean + @Named("SERVICE_BUS_REINDEX_TOPIC") + public String serviceBusReindexTopicName() { + return serviceBusReindexTopicName; + } + @Bean @Named("ELASTIC_CACHE_EXPIRATION") public Integer getElasticCacheExpiration() { @@ -90,12 +95,4 @@ public class AzureBootstrapConfig { return String.format(urlFormat, tenant); } - @Bean - public IEntitlementsFactory entitlementsFactory() { - EntitlementsAPIConfig apiConfig = EntitlementsAPIConfig.builder() - .apiKey(entitlementsAPIKey) - .rootUrl(entitlementsAPIEndpoint) - .build(); - return new EntitlementsFactory(apiConfig); - } } diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/di/EntitlementsClientFactory.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/di/EntitlementsClientFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..e83c404f2e9a3327e232281cc3800c71e45216cb --- /dev/null +++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/di/EntitlementsClientFactory.java @@ -0,0 +1,57 @@ +// Copyright 2017-2019, Schlumberger +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package org.opengroup.osdu.indexer.azure.di; + +import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig; +import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory; +import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory; +import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.beans.factory.config.AbstractFactoryBean; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; +import org.springframework.web.context.annotation.RequestScope; + +@Component +@RequestScope +@Lazy +public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlementsFactory> { + + @Value("${AUTHORIZE_API}") + private String authorizeApi; + + @Value("${AUTHORIZE_API_KEY:}") + private String authorizeApiKey; + + @Autowired + private HttpResponseBodyMapper mapper; + + @Override + protected IEntitlementsFactory createInstance() throws Exception { + + return new EntitlementsFactory(EntitlementsAPIConfig + .builder() + .rootUrl(authorizeApi) + .apiKey(authorizeApiKey) + .build(), + mapper); + } + + @Override + public Class<?> getObjectType() { + return IEntitlementsFactory.class; + } +} diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/DpsHeadersAzureQueue.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/DpsHeadersAzureQueue.java index 2335abb334b8a1960f1028bea2d250285dde97d0..241451e83016a059d60aea5a96fadaa00ae0315b 100644 --- a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/DpsHeadersAzureQueue.java +++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/DpsHeadersAzureQueue.java @@ -33,9 +33,6 @@ import org.springframework.web.context.annotation.RequestScope; @Primary public class DpsHeadersAzureQueue extends DpsHeaders { - @Value("${indexer.queue.key}") - private String queueKey; - //ToDo this should be moved to Azure client-lib public static final String INDEXER_QUEUE_KEY = "x-functions-key"; @@ -47,7 +44,8 @@ public class DpsHeadersAzureQueue extends DpsHeaders { .stream() .collect(Collectors.toMap(h -> h, request::getHeader)); - headers.put(INDEXER_QUEUE_KEY,queueKey); + // TODO: Figure out if this header is actually required to be set for anything + headers.put(INDEXER_QUEUE_KEY, "NOT_USED"); this.addFromMap(headers); diff --git a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java index 7210b4aaa06bb72b607ae31353835ca4353a19d1..4428beb160c4d352ebc24b5cf6fff74d9db5d799 100644 --- a/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java +++ b/provider/indexer-azure/src/main/java/org/opengroup/osdu/indexer/azure/util/IndexerQueueTaskBuilderAzure.java @@ -42,7 +42,6 @@ import javax.inject.Named; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; import java.util.stream.Collectors; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -64,8 +63,8 @@ public class IndexerQueueTaskBuilderAzure extends IndexerQueueTaskBuilder { private JaxRsDpsLog logger; @Inject - @Named("SERVICE_BUS_TOPIC") - private String serviceBusTopic; + @Named("SERVICE_BUS_REINDEX_TOPIC") + private String serviceBusReindexTopicName; @Inject private StorageService storageService; @@ -153,7 +152,7 @@ public class IndexerQueueTaskBuilderAzure extends IndexerQueueTaskBuilder { try { logger.info("Indexer publishes message to Service Bus " + headers.getCorrelationId()); - topicClientFactory.getClient(headers.getPartitionId(), serviceBusTopic).send(message); + topicClientFactory.getClient(headers.getPartitionId(), serviceBusReindexTopicName).send(message); } catch (Exception e) { logger.error(e.getMessage(), e); } diff --git a/provider/indexer-azure/src/main/resources/application.properties b/provider/indexer-azure/src/main/resources/application.properties index 619120f5eeab512b3e0f3316e27156e70b6b9aef..897271df395ef070a6f4971f6cfa824d36436e28 100644 --- a/provider/indexer-azure/src/main/resources/application.properties +++ b/provider/indexer-azure/src/main/resources/application.properties @@ -63,6 +63,7 @@ azure.cosmosdb.database=${cosmosdb_database} #AzureServiceBusconfiguration azure.servicebus.topic-name=${servicebus_topic_name} +azure.servicebus.reindex.topic-name=${reindex_topic_name} #Indexer-Queue-header indexer.queue.key=abcd diff --git a/provider/indexer-gcp/pom.xml b/provider/indexer-gcp/pom.xml index a37a4df8947684574ceb67a8389f5b658fef23c7..ff16763679abd9096948923f2ac504cd6e92ae57 100644 --- a/provider/indexer-gcp/pom.xml +++ b/provider/indexer-gcp/pom.xml @@ -5,12 +5,12 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <artifactId>indexer-gcp</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <name>indexer-gcp</name> <description>Indexer Service GCP App Engine</description> <packaging>jar</packaging> @@ -19,13 +19,13 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-core</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>core-lib-gcp</artifactId> - <version>0.6.1-SNAPSHOT</version> + <version>0.7.0</version> </dependency> <dependency> diff --git a/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/AppExceptionHandler.java b/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/AppExceptionHandler.java index 0e8293b1a59abd37ebdcd59bf3f2610a7c39e813..ebfe87ef077c4bbb244a1b68ba94d9138bfc0753 100644 --- a/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/AppExceptionHandler.java +++ b/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/AppExceptionHandler.java @@ -23,12 +23,36 @@ public class AppExceptionHandler { ? e.getOriginalException().getMessage() : e.getError().getMessage(); - if (e.getError().getCode() > 499) { + Integer errorCode = e.getError().getCode(); + + if (errorCode > 499) { log.error(exceptionMsg, e.getOriginalException()); } else { log.warn(exceptionMsg, e.getOriginalException()); } - return new ResponseEntity<>(e.getError(), HttpStatus.resolve(e.getError().getCode())); + HttpStatus status = Objects.nonNull(HttpStatus.resolve(errorCode)) + ? HttpStatus.resolve(errorCode) + : resolveNotSupportedStatus(errorCode); + + return new ResponseEntity<>(e.getError(), status); + } + + //Currently not all codes provided from core can be resolved by HttpStatus + //example org.opengroup.osdu.core.common.model.http.RequestStatus have not supported by HttpStatus codes + private HttpStatus resolveNotSupportedStatus(int statusCode) { + if (statusCode > 99 && statusCode < 200) { + return HttpStatus.CONTINUE; + } + if (statusCode > 199 && statusCode < 300) { + return HttpStatus.NO_CONTENT; + } + if (statusCode > 299 && statusCode < 400) { + return HttpStatus.MULTIPLE_CHOICES; + } + if (statusCode > 399 && statusCode < 500) { + return HttpStatus.BAD_REQUEST; + } + return HttpStatus.INTERNAL_SERVER_ERROR; } } diff --git a/provider/indexer-gcp/src/main/resources/application.properties b/provider/indexer-gcp/src/main/resources/application.properties index 08ee586c371bc8fecc4e21227ef2b4f1c8b76c5e..2213e4dca947f3ad90a5998299005c613a47ef61 100644 --- a/provider/indexer-gcp/src/main/resources/application.properties +++ b/provider/indexer-gcp/src/main/resources/application.properties @@ -42,5 +42,3 @@ security.https.certificate.trust=false indexer.que.service.mail=default@iam.gserviceaccount.com SCHEMA_HOST=${HOST}/api/schema-service/v1/schema storage-query-kinds-host=https://${STORAGE_HOSTNAME}/api/storage/v2/query/kinds - -schema.converter.supported-array-types=boolean,integer,number,string,object diff --git a/provider/indexer-ibm/pom.xml b/provider/indexer-ibm/pom.xml index f0a0c5f9249d3faba1e8b92e25fd97aced2ff4e8..abe6a5ad4769c95e854a1cc58e3c8702b8db3968 100644 --- a/provider/indexer-ibm/pom.xml +++ b/provider/indexer-ibm/pom.xml @@ -21,7 +21,7 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> @@ -31,7 +31,7 @@ <packaging>jar</packaging> <properties> - <os-core-lib-ibm.version>0.3.8-SNAPSHOT</os-core-lib-ibm.version> + <os-core-lib-ibm.version>0.7.0</os-core-lib-ibm.version> </properties> <profiles> @@ -53,7 +53,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-core</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> </dependency> <dependency> diff --git a/provider/indexer-ibm/src/main/java/org/opengroup/osdu/indexer/ibm/di/EntitlementsClientFactory.java b/provider/indexer-ibm/src/main/java/org/opengroup/osdu/indexer/ibm/di/EntitlementsClientFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..4a1938530b61f5a0530be55a47b30f7d453379bb --- /dev/null +++ b/provider/indexer-ibm/src/main/java/org/opengroup/osdu/indexer/ibm/di/EntitlementsClientFactory.java @@ -0,0 +1,44 @@ + +package org.opengroup.osdu.indexer.ibm.di; + +import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig; +import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory; +import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory; +import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.beans.factory.config.AbstractFactoryBean; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; +import org.springframework.web.context.annotation.RequestScope; + +@Component +@RequestScope +@Lazy +public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlementsFactory> { + + @Value("${AUTHORIZE_API}") + private String AUTHORIZE_API; + + @Value("${AUTHORIZE_API_KEY:}") + private String AUTHORIZE_API_KEY; + + @Autowired + private HttpResponseBodyMapper mapper; + + @Override + protected IEntitlementsFactory createInstance() throws Exception { + + return new EntitlementsFactory(EntitlementsAPIConfig + .builder() + .rootUrl(AUTHORIZE_API) + .apiKey(AUTHORIZE_API_KEY) + .build(), + mapper); + } + + @Override + public Class<?> getObjectType() { + return IEntitlementsFactory.class; + } +} \ No newline at end of file diff --git a/provider/indexer-ibm/src/main/java/org/opengroup/osdu/indexer/ibm/util/IndexerQueueTaskBuilderIbm.java b/provider/indexer-ibm/src/main/java/org/opengroup/osdu/indexer/ibm/util/IndexerQueueTaskBuilderIbm.java index 48490a966c76462f23bf88b55e07a8c51b3c2dc9..2b4e88c68de8b4786c4d80b491ef418dfaf0acbc 100644 --- a/provider/indexer-ibm/src/main/java/org/opengroup/osdu/indexer/ibm/util/IndexerQueueTaskBuilderIbm.java +++ b/provider/indexer-ibm/src/main/java/org/opengroup/osdu/indexer/ibm/util/IndexerQueueTaskBuilderIbm.java @@ -3,6 +3,8 @@ package org.opengroup.osdu.indexer.ibm.util; +import static org.opengroup.osdu.core.common.Constants.WORKER_RELATIVE_URL; + import java.util.Map; import javax.inject.Inject; @@ -46,6 +48,12 @@ public class IndexerQueueTaskBuilderIbm extends IndexerQueueTaskBuilder { public void createReIndexTask(String payload, DpsHeaders headers) { createTask(payload, headers); } + + //used by reindexer api + @Override + public void createWorkerTask(String payload, Long countdownMillis, DpsHeaders headers) { + createTask(payload, headers); + } private void createTask(String payload, DpsHeaders headers) { diff --git a/provider/indexer-reference/pom.xml b/provider/indexer-reference/pom.xml index 64212d38f47c19bfb2de3205a4b1fbf5617d84d5..4a20a160116a32dd5b35a133f3cd24295262b815 100644 --- a/provider/indexer-reference/pom.xml +++ b/provider/indexer-reference/pom.xml @@ -22,12 +22,12 @@ <parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-service</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <artifactId>indexer-reference</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <name>indexer-reference</name> <description>Indexer Service GCP Anthos</description> <packaging>jar</packaging> @@ -36,7 +36,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-core</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> </dependency> <dependency> @@ -48,7 +48,7 @@ <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>os-core-common</artifactId> - <version>0.0.18</version> + <version>0.6.5</version> </dependency> <dependency> diff --git a/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/di/EntitlementsClientFactory.java b/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/di/EntitlementsClientFactory.java index 45131176cd1ff35eb2dc411b0073b245c0d3b8e8..2872c5c53405e12550c901064da117764208dc4f 100644 --- a/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/di/EntitlementsClientFactory.java +++ b/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/di/EntitlementsClientFactory.java @@ -20,6 +20,7 @@ package org.opengroup.osdu.indexer.di; import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig; import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory; import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory; +import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper; import org.opengroup.osdu.indexer.config.EntitlementsConfigProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.AbstractFactoryBean; @@ -34,12 +35,15 @@ public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlements private EntitlementsConfigProperties entitlementsConfigProperties; + @Autowired + private HttpResponseBodyMapper mapper; + @Override protected IEntitlementsFactory createInstance() throws Exception { return new EntitlementsFactory(EntitlementsAPIConfig .builder() .rootUrl(entitlementsConfigProperties.getAuthorizeApi()) - .build()); + .build(), mapper); } @Override diff --git a/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java b/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java index 558e30bcc6d7c6653f51f1d023a56b6f015a5c18..1be2ba81868c6f3ed56cd4b56a25edfdbd576f99 100644 --- a/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java +++ b/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java @@ -68,7 +68,6 @@ import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; @Service -@Primary public class IndexerServiceImpl implements IndexerService { private static final TimeValue BULK_REQUEST_TIMEOUT = TimeValue.timeValueMinutes(1); diff --git a/provider/indexer-reference/src/test/java/org/opengroup/osdu/indexer/middleware/IndexFilterTest.java b/provider/indexer-reference/src/test/java/org/opengroup/osdu/indexer/middleware/IndexFilterTest.java index 9ec5fb7a30044f7f105c9a97229cb37322f218b9..bfc4f3a3330570ea73c59d2721954dd75aded7a5 100644 --- a/provider/indexer-reference/src/test/java/org/opengroup/osdu/indexer/middleware/IndexFilterTest.java +++ b/provider/indexer-reference/src/test/java/org/opengroup/osdu/indexer/middleware/IndexFilterTest.java @@ -51,30 +51,17 @@ public class IndexFilterTest { indexFilter.doFilter(httpServletRequest, httpServletResponse, filterChain); - Mockito.verify(httpServletResponse) - .addHeader("Access-Control-Allow-Origin", Collections.singletonList("*").toString()); - Mockito.verify(httpServletResponse).addHeader("Access-Control-Allow-Headers", Collections - .singletonList( - "origin, content-type, accept, authorization, data-partition-id, correlation-id, appkey") - .toString()); - Mockito.verify(httpServletResponse).addHeader("Access-Control-Allow-Methods", - Collections.singletonList("GET, POST, PUT, DELETE, OPTIONS, HEAD").toString()); - Mockito.verify(httpServletResponse).addHeader("Access-Control-Allow-Credentials", - Collections.singletonList("true").toString()); - Mockito.verify(httpServletResponse) - .addHeader("X-Frame-Options", Collections.singletonList("DENY").toString()); - Mockito.verify(httpServletResponse) - .addHeader("X-XSS-Protection", Collections.singletonList("1; mode=block").toString()); - Mockito.verify(httpServletResponse) - .addHeader("X-Content-Type-Options", Collections.singletonList("nosniff").toString()); - Mockito.verify(httpServletResponse).addHeader("Cache-Control", - Collections.singletonList("no-cache, no-store, must-revalidate").toString()); - Mockito.verify(httpServletResponse).addHeader("Content-Security-Policy", - Collections.singletonList("default-src 'self'").toString()); - Mockito.verify(httpServletResponse).addHeader("Strict-Transport-Security", - Collections.singletonList("max-age=31536000; includeSubDomains").toString()); - Mockito.verify(httpServletResponse) - .addHeader("Expires", Collections.singletonList("0").toString()); + Mockito.verify(httpServletResponse).addHeader("Access-Control-Allow-Origin", Collections.singletonList("*").toString()); + Mockito.verify(httpServletResponse).addHeader("Access-Control-Allow-Headers", Collections.singletonList("origin, content-type, accept, authorization, data-partition-id, correlation-id, appkey").toString()); + Mockito.verify(httpServletResponse).addHeader("Access-Control-Allow-Methods", Collections.singletonList("GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH").toString()); + Mockito.verify(httpServletResponse).addHeader("Access-Control-Allow-Credentials", Collections.singletonList("true").toString()); + Mockito.verify(httpServletResponse).addHeader("X-Frame-Options", Collections.singletonList("DENY").toString()); + Mockito.verify(httpServletResponse).addHeader("X-XSS-Protection", Collections.singletonList("1; mode=block").toString()); + Mockito.verify(httpServletResponse).addHeader("X-Content-Type-Options", Collections.singletonList("nosniff").toString()); + Mockito.verify(httpServletResponse).addHeader("Cache-Control", Collections.singletonList("no-cache, no-store, must-revalidate").toString()); + Mockito.verify(httpServletResponse).addHeader("Content-Security-Policy", Collections.singletonList("default-src 'self'").toString()); + Mockito.verify(httpServletResponse).addHeader("Strict-Transport-Security", Collections.singletonList("max-age=31536000; includeSubDomains").toString()); + Mockito.verify(httpServletResponse).addHeader("Expires", Collections.singletonList("0").toString()); Mockito.verify(httpServletResponse).addHeader("correlation-id", "correlation-id-value"); Mockito.verify(filterChain).doFilter(httpServletRequest, httpServletResponse); } diff --git a/testing/indexer-test-aws/pom.xml b/testing/indexer-test-aws/pom.xml index 9335cf4e8d5323f6ad973d3114af68a272a27220..39bb3942553c46295342e73a07fb12c31a300b24 100644 --- a/testing/indexer-test-aws/pom.xml +++ b/testing/indexer-test-aws/pom.xml @@ -21,13 +21,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-aws</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> @@ -42,7 +42,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-core</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.1-SNAPSHOT</version> </dependency> <!-- AWS specific packages --> diff --git a/testing/indexer-test-aws/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java b/testing/indexer-test-aws/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java index 7539fe6bf4ecb5818479952dd92cf5b2aea54a17..03912e841850bb4b0eb985ff9ea5f52bc1bed098 100644 --- a/testing/indexer-test-aws/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java +++ b/testing/indexer-test-aws/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java @@ -95,4 +95,14 @@ public class Steps extends SchemaServiceRecordSteps { super.iShouldGetTheNumberDocumentsForTheIndexInTheElasticSearchWithOutSkippedAttribute(expectedCount, index, skippedAttributes); } + @Then("^I should be able to search (\\d+) record with index \"([^\"]*)\" by tag \"([^\"]*)\" and value \"([^\"]*)\"$") + public void iShouldBeAbleToSearchRecordByTagKeyAndTagValue(int expectedNumber, String index, String tagKey, String tagValue) throws Throwable { + super.iShouldBeAbleToSearchRecordByTagKeyAndTagValue(index, tagKey, tagValue, expectedNumber); + } + + @Then("^I should be able search (\\d+) documents for the \"([^\"]*)\" by bounding box query with points \\((-?\\d+), (-?\\d+)\\) and \\((-?\\d+), (-?\\d+)\\) on field \"(.*?)\"$") + public void i_should_get_the_documents_for_the_in_the_Elastic_Search_by_geoQuery ( + int expectedCount, String index, Double topLatitude, Double topLongitude, Double bottomLatitude, Double bottomLongitude, String field) throws Throwable { + super.i_should_get_the_documents_for_the_in_the_Elastic_Search_by_geoQuery(expectedCount, index, topLatitude, topLongitude, bottomLatitude, bottomLongitude, field); + } } \ No newline at end of file diff --git a/testing/indexer-test-azure/pom.xml b/testing/indexer-test-azure/pom.xml index 2a6703142879b538f3f01319953cb9aa18833633..baa5cd8b14b926f98b4a979e5efbe23d9309b4cd 100644 --- a/testing/indexer-test-azure/pom.xml +++ b/testing/indexer-test-azure/pom.xml @@ -21,13 +21,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-azure</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> @@ -45,14 +45,32 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-core</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.1-SNAPSHOT</version> </dependency> <!-- Azure dependencies --> + <!--Added dependency for utilizing azure service principle class--> <dependency> <groupId>org.opengroup.osdu</groupId> <artifactId>core-lib-azure</artifactId> <version>0.0.33</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>com.azure</groupId> + <artifactId>azure-core-http-netty</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-all</artifactId> + <version>4.1.50.Final</version> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-transport</artifactId> + <version>4.1.15.Final</version> </dependency> <dependency> @@ -166,28 +184,5 @@ <version>3.0.0</version> <scope>test</scope> </dependency> -<!--Added dependency for utilizing azure service principle class--> - <dependency> - <groupId>org.opengroup.osdu</groupId> - <artifactId>core-lib-azure</artifactId> - <version>0.0.33</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>com.azure</groupId> - <artifactId>azure-core-http-netty</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>io.netty</groupId> - <artifactId>netty-all</artifactId> - <version>4.1.50.Final</version> - </dependency> - <dependency> - <groupId>io.netty</groupId> - <artifactId>netty-transport</artifactId> - <version>4.1.15.Final</version> - </dependency> </dependencies> -</project> \ No newline at end of file +</project> diff --git a/testing/indexer-test-azure/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java b/testing/indexer-test-azure/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java index ac04a614d3aea7ef3760a7f8e7d20d3afbe323b6..c0a9390d2537b7359e8d291b9a06514d1a223385 100644 --- a/testing/indexer-test-azure/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java +++ b/testing/indexer-test-azure/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java @@ -14,14 +14,13 @@ package org.opengroup.osdu.step_definitions.index.record; +import cucumber.api.DataTable; import cucumber.api.Scenario; import cucumber.api.java.Before; -import lombok.extern.java.Log; - -import cucumber.api.DataTable; import cucumber.api.java.en.Given; import cucumber.api.java.en.Then; import cucumber.api.java.en.When; +import lombok.extern.java.Log; import org.opengroup.osdu.common.SchemaServiceRecordSteps; import org.opengroup.osdu.util.AzureHTTPClient; import org.opengroup.osdu.util.ElasticUtils; @@ -69,4 +68,14 @@ public class Steps extends SchemaServiceRecordSteps { super.iShouldGetTheNumberDocumentsForTheIndexInTheElasticSearchWithOutSkippedAttribute(expectedCount, index, skippedAttributes); } + @Then("^I should be able to search (\\d+) record with index \"([^\"]*)\" by tag \"([^\"]*)\" and value \"([^\"]*)\"$") + public void iShouldBeAbleToSearchRecordByTagKeyAndTagValue(int expectedNumber, String index, String tagKey, String tagValue) throws Throwable { + super.iShouldBeAbleToSearchRecordByTagKeyAndTagValue(index, tagKey, tagValue, expectedNumber); + } + + @Then("^I should be able search (\\d+) documents for the \"([^\"]*)\" by bounding box query with points \\((-?\\d+), (-?\\d+)\\) and \\((-?\\d+), (-?\\d+)\\) on field \"([^\"]*)\"$") + public void i_should_get_the_documents_for_the_in_the_Elastic_Search_by_geoQuery( + int expectedCount, String index, Double topLatitude, Double topLongitude, Double bottomLatitude, Double bottomLongitude, String field) throws Throwable { + super.i_should_get_the_documents_for_the_in_the_Elastic_Search_by_geoQuery(expectedCount, index, topLatitude, topLongitude, bottomLatitude, bottomLongitude, field); + } } \ No newline at end of file diff --git a/testing/indexer-test-core/pom.xml b/testing/indexer-test-core/pom.xml index 37659e5ba08a4f640dc0d678e5e453128833ba1c..e9c63cd00626c17b308d31727da789878acf3e1a 100644 --- a/testing/indexer-test-core/pom.xml +++ b/testing/indexer-test-core/pom.xml @@ -5,13 +5,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-core</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.1-SNAPSHOT</version> <properties> <maven.compiler.target>1.8</maven.compiler.target> @@ -109,7 +109,27 @@ <artifactId>elasticsearch-rest-high-level-client</artifactId> <version>7.8.1</version> </dependency> - + <dependency> + <groupId>org.locationtech.jts.io</groupId> + <artifactId>jts-io-common</artifactId> + <version>1.15.0</version> + </dependency> + <dependency> + <groupId>org.locationtech.spatial4j</groupId> + <artifactId>spatial4j</artifactId> + <version>0.7</version> + </dependency> + <dependency> + <groupId>com.vividsolutions</groupId> + <artifactId>jts</artifactId> + <version>1.13</version> + <exclusions> + <exclusion> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + </exclusion> + </exclusions> + </dependency> <!--Logging--> <dependency> <groupId>org.apache.logging.log4j</groupId> diff --git a/testing/indexer-test-core/src/main/java/org/opengroup/osdu/common/RecordSteps.java b/testing/indexer-test-core/src/main/java/org/opengroup/osdu/common/RecordSteps.java index 1b420a262c01c5c1429ee8f0e7830b0b04bccb87..1833e8de97da21b5e1be5602f74f6af85716816b 100644 --- a/testing/indexer-test-core/src/main/java/org/opengroup/osdu/common/RecordSteps.java +++ b/testing/indexer-test-core/src/main/java/org/opengroup/osdu/common/RecordSteps.java @@ -25,6 +25,7 @@ import java.lang.reflect.Type; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; import java.util.logging.Level; import static org.junit.Assert.*; @@ -167,6 +168,21 @@ public class RecordSteps extends TestsBase { assertEquals(expectedCount, documentCountByQuery); } + public void iShouldBeAbleToSearchRecordByTagKeyAndTagValue(String index, String tagKey, String tagValue, int expectedNumber) throws Throwable { + TimeUnit.SECONDS.sleep(40); + index = generateActualName(index, timeStamp); + long actualNumberOfRecords = elasticUtils.fetchRecordsByTags(index, tagKey, tagValue); + assertEquals(expectedNumber, actualNumberOfRecords); + } + + public void i_should_get_the_documents_for_the_in_the_Elastic_Search_by_geoQuery ( + int expectedNumber, String index, Double topLatitude, Double topLongitude, Double bottomLatitude, Double bottomLongitude, String field) throws Throwable { + index = generateActualName(index, timeStamp); + long numOfIndexedDocuments = createIndex(index); + long actualNumberOfRecords = elasticUtils.fetchRecordsByBoundingBoxQuery(index, field, topLatitude, topLongitude, bottomLatitude, bottomLongitude); + assertEquals(expectedNumber, actualNumberOfRecords); + } + private long createIndex(String index) throws InterruptedException, IOException { long numOfIndexedDocuments = 0; int iterator; diff --git a/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java b/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java index 452b8fd308a333af94707c3513d1018f1c8e6b59..c5e8dc7f96caa8a01fdbbb1a78be3f7b4267f460 100644 --- a/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java +++ b/testing/indexer-test-core/src/main/java/org/opengroup/osdu/util/ElasticUtils.java @@ -18,10 +18,12 @@ package org.opengroup.osdu.util; import com.google.gson.Gson; + import java.security.KeyManagementException; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import javax.net.ssl.SSLContext; + import lombok.extern.java.Log; import org.apache.http.Header; import org.apache.http.HttpHost; @@ -49,7 +51,8 @@ import org.elasticsearch.client.indices.GetIndexRequest; import org.elasticsearch.client.indices.GetMappingsRequest; import org.elasticsearch.client.indices.GetMappingsResponse; import org.elasticsearch.cluster.metadata.MappingMetadata; -import org.elasticsearch.common.collect.ImmutableOpenMap; +import org.locationtech.jts.geom.Coordinate; +import org.elasticsearch.common.geo.builders.EnvelopeBuilder; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentType; @@ -59,9 +62,12 @@ import org.elasticsearch.search.builder.SearchSourceBuilder; import java.io.IOException; import java.util.*; +import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.stream.Collectors; +import static org.elasticsearch.index.query.QueryBuilders.*; + /** * All util methods to use elastic apis for tests @@ -215,6 +221,22 @@ public class ElasticUtils { } } + public long fetchRecordsByTags(String index, String tagKey, String tagValue) throws IOException { + try { + try (RestHighLevelClient client = this.createClient(username, password, host)) { + SearchRequest request = new SearchRequest(index); + SearchSourceBuilder sourceBuilder = new SearchSourceBuilder(); + sourceBuilder.query(boolQuery().must(termsQuery(String.format("tags.%s", tagKey), tagValue))); + request.source(sourceBuilder); + SearchResponse searchResponse = client.search(request, RequestOptions.DEFAULT); + return searchResponse.getHits().getTotalHits().value; + } + } catch (ElasticsearchStatusException e) { + log.log(Level.INFO, String.format("Elastic search threw exception: %s", e.getMessage())); + return -1; + } + } + public Map<String, Map<String, Object>> fetchRecordsData(String index) throws IOException { try { try (RestHighLevelClient client = this.createClient(username, password, host)) { @@ -232,8 +254,9 @@ public class ElasticUtils { } } - public long fetchRecordsByExistQuery(String index, String attributeName) throws IOException { + public long fetchRecordsByExistQuery(String index, String attributeName) throws Exception { try { + TimeUnit.SECONDS.sleep(40); try (RestHighLevelClient client = this.createClient(username, password, host)) { SearchRequest searchRequest = new SearchRequest(index); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); @@ -249,6 +272,23 @@ public class ElasticUtils { } } + public long fetchRecordsByBoundingBoxQuery(String index, String field, Double topLatitude, Double topLongitude, Double bottomLatitude, Double bottomLongitude) throws Exception { + try (RestHighLevelClient client = this.createClient(username, password, host)) { + SearchRequest searchRequest = new SearchRequest(index); + SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); + Coordinate topLeft = new Coordinate(topLongitude, topLatitude); + Coordinate bottomRight = new Coordinate(bottomLongitude, bottomLatitude); + searchSourceBuilder.query(boolQuery().must(geoWithinQuery(field, new EnvelopeBuilder(topLeft, bottomRight)))); + searchRequest.source(searchSourceBuilder); + + SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT); + return searchResponse.getHits().getTotalHits().value; + } catch (ElasticsearchStatusException e) { + log.log(Level.INFO, String.format("Elastic search threw exception: %s", e.getMessage())); + return -1; + } + } + public Map<String, MappingMetadata> getMapping(String index) throws IOException { try (RestHighLevelClient client = this.createClient(username, password, host)) { GetMappingsRequest request = new GetMappingsRequest(); diff --git a/testing/indexer-test-core/src/main/resources/features/indexrecord/IndexRecord.feature b/testing/indexer-test-core/src/main/resources/features/indexrecord/IndexRecord.feature index a06fa2efcbcb9107b184934c0304bf105afbb85e..3e1a935f606ae0e0758074ae2106ac03893f23c7 100644 --- a/testing/indexer-test-core/src/main/resources/features/indexrecord/IndexRecord.feature +++ b/testing/indexer-test-core/src/main/resources/features/indexrecord/IndexRecord.feature @@ -15,8 +15,8 @@ Feature: Indexing of the documents Examples: | kind | recordFile | number | index | type | acl | mapping | - | "tenant1:testindex<timestamp>:well:1.0.0" | "index_records_1" | 5 | "tenant1-testindex<timestamp>-well-1.0.0" | "well" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" | - | "tenant1:testindex<timestamp>:well:3.0.0" | "index_records_1" | 5 | "tenant1-testindex<timestamp>-well-3.0.0" | "well" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" | + | "tenant1:testindex<timestamp>:well:1.0.0" | "index_records_1" | 5 | "tenant1-testindex<timestamp>-well-1.0.0" | "well" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"long"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" | + | "tenant1:testindex<timestamp>:well:3.0.0" | "index_records_1" | 5 | "tenant1-testindex<timestamp>-well-3.0.0" | "well" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"long"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" | Scenario Outline: Ingest the record and Index in the Elastic Search with bad attribute When I ingest records with the <recordFile> with <acl> for a given <kind> diff --git a/testing/indexer-test-core/src/main/resources/features/indexrecord/indexRecord-schema-service.feature b/testing/indexer-test-core/src/main/resources/features/indexrecord/indexRecord-schema-service.feature index 44e24e75641b6cbb73c2749397880e2de586a6ab..3531a34cda79b814119c547824e537f2380c63b4 100644 --- a/testing/indexer-test-core/src/main/resources/features/indexrecord/indexRecord-schema-service.feature +++ b/testing/indexer-test-core/src/main/resources/features/indexrecord/indexRecord-schema-service.feature @@ -3,10 +3,11 @@ Feature: Indexing of the documents Background: Given the schema is created with the following kind - | kind | index | schemaFile | - | tenant1:indexer-int-test:sample-schema-1:2.0.4 | tenant1-indexer-int-test:sample-schema-1-2.0.4 | index_records_1 | - | tenant1:indexer-int-test:sample-schema-2:1.0.4 | tenant1-indexer-int-test:sample-schema-2-1.0.4 | index_records_2 | - | tenant1:indexer-int-test:sample-schema-3:1.0.4 | tenant1-indexer-int-test:sample-schema-3-1.0.4 | index_records_3 | + | kind | index | schemaFile | + | tenant1:indexer:test-data--Integration:1.0.0 | tenant1-indexer-test-data--integration-1.0.0 | index_records_1 | + | tenant1:indexer:test-data--Integration:2.0.0 | tenant1-indexer-test-data--integration-2.0.0 | index_records_2 | + | tenant1:indexer:test-data--Integration:3.0.0 | tenant1-indexer-test-data--integration-3.0.0 | index_records_3 | + | tenant1:wks:master-data--Wellbore:2.0.3 | tenant1-wks-master-data--wellbore-2.0.3 | r3-index_record_wks_master | Scenario Outline: Ingest the record and Index in the Elastic Search When I ingest records with the <recordFile> with <acl> for a given <kind> @@ -15,15 +16,30 @@ Feature: Indexing of the documents Then I should get expected <elastic_data> values in the source section of Elastic Search results for the <index> Examples: - | kind | recordFile | number | index | type | acl | mapping | elastic_data | - | "tenant1:indexer-int-test:sample-schema-1:2.0.4" | "index_records_1" | 5 | "tenant1-indexer-int-test-sample-schema-1-2.0.4" | "sample-schema-1" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" | "elastic_data_schema_1.json" | - | "tenant1:indexer-int-test:sample-schema-3:1.0.4" | "index_records_1" | 5 | "tenant1-indexer-int-test-sample-schema-3-1.0.4" | "sample-schema-3" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" | "elastic_data_schema_3.json" | + | kind | recordFile | number | index | type | acl | mapping | elastic_data | + | "tenant1:indexer:test-data--Integration:1.0.0" | "index_records_schema_1" | 5 | "tenant1-indexer-test-data--integration-1.0.0" | "test-data--Integration" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"long"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" | "elastic_data_schema_1.json" | + | "tenant1:indexer:test-data--Integration:3.0.0" | "index_records_schema_3" | 7 | "tenant1-indexer-test-data--integration-3.0.0" | "test-data--Integration" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"long"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" | "elastic_data_schema_3.json" | Scenario Outline: Ingest the record and Index in the Elastic Search with bad attribute When I ingest records with the <recordFile> with <acl> for a given <kind> Then I should get the <number> documents for the <index> in the Elastic Search with out <skippedAttribute> Examples: - | kind | recordFile | number | index | skippedAttribute | acl | - | "tenant1:indexer-int-test:sample-schema-2:1.0.4" | "index_records_2" | 4 | "tenant1-indexer-int-test-sample-schema-2-1.0.4" | "data.Location" | "data.default.viewers@tenant1" | - | "tenant1:indexer-int-test:sample-schema-3:1.0.4" | "index_records_3" | 7 | "tenant1-indexer-int-test-sample-schema-3-1.0.4" | "data.GeoShape" | "data.default.viewers@tenant1" | + | kind | recordFile | number | index | skippedAttribute | acl | + | "tenant1:indexer:test-data--Integration:2.0.0" | "index_records_2" | 4 | "tenant1-indexer-test-data--integration-2.0.0" | "data.Location" | "data.default.viewers@tenant1" | + + Scenario Outline: Ingest the record and Index in the Elastic Search with tags + When I ingest records with the <recordFile> with <acl> for a given <kind> + Then I should be able to search <number> record with index <index> by tag <tagKey> and value <tagValue> + + Examples: + | kind | recordFile | index | acl | tagKey | tagValue | number | + | "tenant1:indexer:test-data--Integration:1.0.0" | "index_records_schema_1" | "tenant1-indexer-test-data--integration-1.0.0" | "data.default.viewers@tenant1" | "testtag" | "testvalue" | 5 | + + Scenario Outline: Ingest the r3-record with geo-shape and Index in the Elastic Search + When I ingest records with the <recordFile> with <acl> for a given <kind> + Then I should be able search <number> documents for the <index> by bounding box query with points (<top_left_latitude>, <top_left_longitude>) and (<bottom_right_latitude>, <bottom_right_longitude>) on field <field> + + Examples: + | kind | recordFile | number | index | acl | field | top_left_latitude | top_left_longitude | bottom_right_latitude | bottom_right_longitude | + | "tenant1:wks:master-data--Wellbore:2.0.3" | "r3-index_record_wks_master" | 1 | "tenant1-wks-master-data--wellbore-2.0.3" | "data.default.viewers@tenant1" | "data.SpatialLocation.Wgs84Coordinates" | 52 | -100 | 0 | 100 | diff --git a/testing/indexer-test-core/src/main/resources/testData/elastic_data_schema_1.json b/testing/indexer-test-core/src/main/resources/testData/elastic_data_schema_1.json index 3452bc41643f91b1a37d219ce6f91d15acee1f21..099e89303a035b51779cd1ef28f702a3ee4eeee4 100644 --- a/testing/indexer-test-core/src/main/resources/testData/elastic_data_schema_1.json +++ b/testing/indexer-test-core/src/main/resources/testData/elastic_data_schema_1.json @@ -1,5 +1,5 @@ { - "opendes:sample-schema-1:testIngest6": { + "opendes:test-data--Integration:testIngest6": { "WellName": "Data Platform Services", "WellStatus": "Under development", "WellType": "Data Lake Cloud", @@ -11,18 +11,6 @@ "EmptyAttribute": "", "Basin": "Houston", "State": "TX", - "x-geojson": { - "geometries": [ - { - "coordinates": [ - -86.565593, - 32.406403 - ], - "type": "point" - } - ], - "type": "geometrycollection" - }, "Country": "USA", "Established": "2000-03-27T23:38:48+0000", "Location": { @@ -30,30 +18,22 @@ "lat": 32.406403 } }, - "opendes:sample-schema-1:testIngest3": { + "opendes:test-data--Integration:testIngest3": { "WellName": "Data Platform Services", "WellStatus": "Under development", "WellType": "Data Lake Cloud", "Rank": 1, + "DblArray": [ + 62.4, + 60.0 + ], "County": "Harris", "Field": "OSDU OFFICE - 2", - "Score": 123456789123456789, + "Score" : 123456789123456789, "OriginalOperator": "OFFICE2", "EmptyAttribute": "", "Basin": "Houston", "State": "TX", - "x-geojson": { - "geometries": [ - { - "coordinates": [ - -86.565593, - 32.406403 - ], - "type": "point" - } - ], - "type": "geometrycollection" - }, "Country": "USA", "Established": "2000-03-27T23:38:48+0000", "Location": { @@ -61,30 +41,23 @@ "lat": 32.406403 } }, - "opendes:sample-schema-1:testIngest2": { + "opendes:test-data--Integration:testIngest2": { "WellName": "Data Platform Services", "WellStatus": "Under development", "WellType": "Data Lake Cloud", "Rank": 1, + "DblArray": [ + 32.4, + 36.45, + 40.0 + ], "County": "Harris", "Field": "OSDU OFFICE - 2", - "Score": 123456789123456789, + "Score" : 123456789123456789, "OriginalOperator": "OFFICE - 2", "EmptyAttribute": "", "Basin": "Houston", "State": "TX", - "x-geojson": { - "geometries": [ - { - "coordinates": [ - -86.565593, - 32.406403 - ], - "type": "point" - } - ], - "type": "geometrycollection" - }, "Country": "USA", "Established": "2000-03-27T23:38:48+0000", "Location": { @@ -92,30 +65,18 @@ "lat": 32.406403 } }, - "opendes:sample-schema-1:testIngest5": { + "opendes:test-data--Integration:testIngest5": { "WellName": "Data Platform Services", "WellStatus": "Under development", "WellType": "Data Lake Cloud", "Rank": 1, "County": "Harris", "Field": "OSDU OFFICE - 2", - "Score": 123456789123456789, + "Score" : 123456789123456789, "OriginalOperator": "OFFICE2", "EmptyAttribute": "", "Basin": "Houston", "State": "TX", - "x-geojson": { - "geometries": [ - { - "coordinates": [ - -86.565593, - 32.406403 - ], - "type": "point" - } - ], - "type": "geometrycollection" - }, "Country": "USA", "Established": "2000-03-27T23:38:48+0000", "Location": { @@ -123,30 +84,18 @@ "lat": 32.406403 } }, - "opendes:sample-schema-1:testIngest4": { + "opendes:test-data--Integration:testIngest4": { "WellName": "Data Platform Services", "WellStatus": "Under development", "WellType": "Data Lake Cloud", "Rank": 1, "County": "Harris", "Field": "OSDU OFFICE - 2", - "Score": 123456789123456789, + "Score" : 123456789123456789, "OriginalOperator": "OFFICE2", "EmptyAttribute": "", "Basin": "Houston", "State": "TX", - "x-geojson": { - "geometries": [ - { - "coordinates": [ - -86.565593, - 32.406403 - ], - "type": "point" - } - ], - "type": "geometrycollection" - }, "Country": "USA", "Established": "2000-03-27T23:38:48+0000", "Location": { diff --git a/testing/indexer-test-core/src/main/resources/testData/elastic_data_schema_3.json b/testing/indexer-test-core/src/main/resources/testData/elastic_data_schema_3.json index 118ae64d6b2323f46a8f21ef8a92b0e79ef33b0d..ede20b1c8908a2aedb79b3f2cdac5ec91eee5654 100644 --- a/testing/indexer-test-core/src/main/resources/testData/elastic_data_schema_3.json +++ b/testing/indexer-test-core/src/main/resources/testData/elastic_data_schema_3.json @@ -1,17 +1,501 @@ { - "opendes:sample-schema-3:testIngest6": { - "WellName": "Data Platform Services" + "opendes:test-data--Integration:testIngest56": { + "WellName": "Data Platform Services - 56", + "GeoShape": { + "geometries": [ + { + "coordinates": [ + [ + [ + [ + 107.0, + 7.0 + ], + [ + 108.0, + 7.0 + ], + [ + 108.0, + 8.0 + ], + [ + 107.0, + 8.0 + ], + [ + 107.0, + 7.0 + ] + ] + ], + [ + [ + [ + 100.0, + 0.0 + ], + [ + 101.0, + 0.0 + ], + [ + 101.0, + 1.0 + ], + [ + 100.0, + 1.0 + ], + [ + 100.0, + 0.0 + ] + ] + ] + ], + "type": "multipolygon" + } + ], + "type": "geometrycollection" + } }, - "opendes:sample-schema-3:testIngest3": { - "WellName": "Data Platform Services" + "opendes:test-data--Integration:testIngest57": { + "WellName": "Data Platform Services - 57", + "GeoShape": { + "geometries": [ + { + "coordinates": [ + [ + -80.662372, + 35.059509 + ], + [ + -80.662693, + 35.059263 + ], + [ + -80.662844, + 35.05893 + ], + [ + -80.66308, + 35.058332 + ], + [ + -80.663595, + 35.057753 + ], + [ + -80.663874, + 35.057401 + ], + [ + -80.66441, + 35.057033 + ], + [ + -80.664861, + 35.056787 + ], + [ + -80.665419, + 35.056506 + ], + [ + -80.665633, + 35.056312 + ], + [ + -80.666019, + 35.055891 + ], + [ + -80.666191, + 35.055452 + ], + [ + -80.666191, + 35.055171 + ], + [ + -80.666255, + 35.05489 + ], + [ + -80.666213, + 35.054222 + ], + [ + -80.666213, + 35.053924 + ], + [ + -80.665955, + 35.052905 + ], + [ + -80.665698, + 35.052044 + ], + [ + -80.665504, + 35.051482 + ], + [ + -80.665762, + 35.050481 + ], + [ + -80.66617, + 35.049725 + ], + [ + -80.666513, + 35.049286 + ], + [ + -80.666921, + 35.048531 + ], + [ + -80.667006, + 35.048215 + ], + [ + -80.667071, + 35.047775 + ], + [ + -80.667049, + 35.047389 + ], + [ + -80.666964, + 35.046985 + ], + [ + -80.666813, + 35.046353 + ], + [ + -80.666599, + 35.045966 + ], + [ + -80.666406, + 35.045615 + ], + [ + -80.665998, + 35.045193 + ], + [ + -80.665526, + 35.044877 + ], + [ + -80.664989, + 35.044543 + ], + [ + -80.664496, + 35.044174 + ], + [ + -80.663852, + 35.043876 + ], + [ + -80.663037, + 35.043717 + ] + ], + "type": "linestring" + } + ], + "type": "geometrycollection" + } }, - "opendes:sample-schema-3:testIngest2": { - "WellName": "Data Platform Services" + "opendes:test-data--Integration:testIngest52": { + "WellName": "Data Platform Services - 52", + "GeoShape": { + "geometries": [ + { + "coordinates": [ + [ + -105.01621, + 39.57422 + ], + [ + -80.666513, + 35.053994 + ] + ], + "type": "multipoint" + } + ], + "type": "geometrycollection" + } }, - "opendes:sample-schema-3:testIngest5": { - "WellName": "Data Platform Services" + "opendes:test-data--Integration:testIngest53": { + "WellName": "Data Platform Services - 53", + "GeoShape": { + "geometries": [ + { + "coordinates": [ + [ + -101.744384, + 39.32155 + ], + [ + -101.552124, + 39.330048 + ], + [ + -101.403808, + 39.330048 + ], + [ + -101.332397, + 39.364032 + ], + [ + -101.041259, + 39.368279 + ], + [ + -100.975341, + 39.304549 + ], + [ + -100.914916, + 39.245016 + ], + [ + -100.843505, + 39.164141 + ], + [ + -100.805053, + 39.104488 + ], + [ + -100.491943, + 39.100226 + ], + [ + -100.437011, + 39.095962 + ], + [ + -100.338134, + 39.095962 + ], + [ + -100.195312, + 39.027718 + ], + [ + -100.008544, + 39.010647 + ], + [ + -99.865722, + 39.00211 + ], + [ + -99.684448, + 38.972221 + ], + [ + -99.51416, + 38.929502 + ], + [ + -99.382324, + 38.920955 + ], + [ + -99.321899, + 38.895308 + ], + [ + -99.113159, + 38.869651 + ], + [ + -99.0802, + 38.85682 + ], + [ + -98.822021, + 38.85682 + ], + [ + -98.448486, + 38.848264 + ], + [ + -98.206787, + 38.848264 + ], + [ + -98.020019, + 38.878204 + ], + [ + -97.635498, + 38.873928 + ] + ], + "type": "linestring" + } + ], + "type": "geometrycollection" + } }, - "opendes:sample-schema-3:testIngest4": { - "WellName": "Data Platform Services" + "opendes:test-data--Integration:testIngest54": { + "WellName": "Data Platform Services - 54", + "GeoShape": { + "geometries": [ + { + "coordinates": [ + [ + [ + -105.021443, + 39.578057 + ], + [ + -105.021507, + 39.577809 + ], + [ + -105.021572, + 39.577495 + ], + [ + -105.021572, + 39.577164 + ], + [ + -105.021572, + 39.577032 + ], + [ + -105.021529, + 39.576784 + ] + ], + [ + [ + -105.019898, + 39.574997 + ], + [ + -105.019598, + 39.574898 + ], + [ + -105.019061, + 39.574782 + ] + ], + [ + [ + -105.017173, + 39.574402 + ], + [ + -105.01698, + 39.574385 + ], + [ + -105.016636, + 39.574385 + ], + [ + -105.016508, + 39.574402 + ], + [ + -105.01595, + 39.57427 + ] + ], + [ + [ + -105.014276, + 39.573972 + ], + [ + -105.014126, + 39.574038 + ], + [ + -105.013825, + 39.57417 + ], + [ + -105.01331, + 39.574452 + ] + ] + ], + "type": "multilinestring" + } + ], + "type": "geometrycollection" + } + }, + "opendes:test-data--Integration:testIngest55": { + "WellName": "Data Platform Services - 55", + "GeoShape": { + "geometries": [ + { + "coordinates": [ + [ + [ + 100.0, + 0.0 + ], + [ + 101.0, + 0.0 + ], + [ + 101.0, + 1.0 + ], + [ + 100.0, + 1.0 + ], + [ + 100.0, + 0.0 + ] + ] + ], + "type": "polygon" + } + ], + "type": "geometrycollection" + } + }, + "opendes:test-data--Integration:testIngest51": { + "WellName": "Data Platform Services - 51", + "GeoShape": { + "geometries": [ + { + "coordinates": [ + -105.01621, + 39.57422 + ], + "type": "point" + } + ], + "type": "geometrycollection" + } } } \ No newline at end of file diff --git a/testing/indexer-test-core/src/main/resources/testData/index_records_1.json b/testing/indexer-test-core/src/main/resources/testData/index_records_1.json index 7affccb493fe398b9a8bc67fa4943d98416c3f32..d219115b89d9c1f2a461b472b0d6addd79d99ab8 100644 --- a/testing/indexer-test-core/src/main/resources/testData/index_records_1.json +++ b/testing/indexer-test-core/src/main/resources/testData/index_records_1.json @@ -1,6 +1,9 @@ [ { "id": "tenant1:<kindSubType>:testIngest2<timestamp>", + "tags": { + "testtag": "testvalue" + }, "data": { "Field": "OSDU OFFICE - 2", "Location": { @@ -24,6 +27,9 @@ }, { "id": "tenant1:<kindSubType>:testIngest3<timestamp>", + "tags": { + "testtag": "testvalue" + }, "data": { "Field": "OSDU OFFICE - 2", "Location": { @@ -47,6 +53,9 @@ }, { "id": "tenant1:<kindSubType>:testIngest4<timestamp>", + "tags": { + "testtag": "testvalue" + }, "data": { "Field": "OSDU OFFICE - 2", "Location": { @@ -69,6 +78,9 @@ }, { "id": "tenant1:<kindSubType>:testIngest5<timestamp>", + "tags": { + "testtag": "testvalue" + }, "data": { "Field": "OSDU OFFICE - 2", "Location": { @@ -91,6 +103,9 @@ }, { "id": "tenant1:<kindSubType>:testIngest6<timestamp>", + "tags": { + "testtag": "testvalue" + }, "data": { "Field": "OSDU OFFICE - 2", "Location": { diff --git a/testing/indexer-test-core/src/main/resources/testData/index_records_1.schema.json b/testing/indexer-test-core/src/main/resources/testData/index_records_1.schema.json index 84cd895bd7d3014fb941a7f5d9b9db703fa97223..6262e8f95aeb8a24b802a9a257f4b325c17f4c3a 100644 --- a/testing/indexer-test-core/src/main/resources/testData/index_records_1.schema.json +++ b/testing/indexer-test-core/src/main/resources/testData/index_records_1.schema.json @@ -2,11 +2,11 @@ "schemaInfo": { "schemaIdentity": { "authority": "tenant1", - "source": "indexer-int-test", - "entityType": "sample-schema-1", - "schemaVersionMajor": "2", + "source": "indexer", + "entityType": "test-data--Integration", + "schemaVersionMajor": "1", "schemaVersionMinor": "0", - "schemaVersionPatch": "4" + "schemaVersionPatch": "0" }, "status": "DEVELOPMENT" }, @@ -21,7 +21,7 @@ "type": "string" }, "Location": { - "$ref": "#/definitions/core_dl_geopoint", + "$ref": "#/definitions/opendes:wks:core_dl_geopoint:1.0.0", "description": "The wellbore's position .", "format": "core:dl:geopoint:1.0.0", "title": "WGS 84 Position", @@ -89,6 +89,33 @@ } ] } + }, + "definitions": { + "opendes:wks:core_dl_geopoint:1.0.0": { + "description": "A 2D point location in latitude and longitude referenced to WGS 84 if not specified otherwise.", + "properties": { + "latitude": { + "description": "The latitude value in degrees of arc (dega). Value range [-90, 90].", + "maximum": 90, + "minimum": -90, + "title": "Latitude", + "type": "number" + }, + "longitude": { + "description": "The longitude value in degrees of arc (dega). Value range [-180, 180]", + "maximum": 180, + "minimum": -180, + "title": "Longitude", + "type": "number" + } + }, + "required": [ + "latitude", + "longitude" + ], + "title": "2D Map Location", + "type": "object" + } } } } \ No newline at end of file diff --git a/testing/indexer-test-core/src/main/resources/testData/index_records_2.schema.json b/testing/indexer-test-core/src/main/resources/testData/index_records_2.schema.json index 869df29b7a4c99aa8ffb38adfe18d1e6faa707ff..e67e19502e0283bdf977b03ff5a59dd27883cfa0 100644 --- a/testing/indexer-test-core/src/main/resources/testData/index_records_2.schema.json +++ b/testing/indexer-test-core/src/main/resources/testData/index_records_2.schema.json @@ -2,11 +2,11 @@ "schemaInfo": { "schemaIdentity": { "authority": "tenant1", - "source": "indexer-int-test", - "entityType": "sample-schema-2", - "schemaVersionMajor": "1", + "source": "indexer", + "entityType": "test-data--Integration", + "schemaVersionMajor": "2", "schemaVersionMinor": "0", - "schemaVersionPatch": "4" + "schemaVersionPatch": "0" }, "status": "DEVELOPMENT" }, @@ -21,7 +21,7 @@ "type": "string" }, "Location": { - "$ref": "#/definitions/core_dl_geopoint", + "$ref": "#/definitions/opendes:wks:core_dl_geopoint:1.0.0", "description": "The wellbore's position .", "format": "core:dl:geopoint:1.0.0", "title": "WGS 84 Position", @@ -70,6 +70,33 @@ } ] } + }, + "definitions": { + "opendes:wks:core_dl_geopoint:1.0.0": { + "description": "A 2D point location in latitude and longitude referenced to WGS 84 if not specified otherwise.", + "properties": { + "latitude": { + "description": "The latitude value in degrees of arc (dega). Value range [-90, 90].", + "maximum": 90, + "minimum": -90, + "title": "Latitude", + "type": "number" + }, + "longitude": { + "description": "The longitude value in degrees of arc (dega). Value range [-180, 180]", + "maximum": 180, + "minimum": -180, + "title": "Longitude", + "type": "number" + } + }, + "required": [ + "latitude", + "longitude" + ], + "title": "2D Map Location", + "type": "object" + } } } } \ No newline at end of file diff --git a/testing/indexer-test-core/src/main/resources/testData/index_records_3.json b/testing/indexer-test-core/src/main/resources/testData/index_records_3.json index 983e7bdb99dbe39246cc4ece07a9b3d434bddb5d..58a7e0deefb054eee8fcf7c6ad1719ecd7ff879f 100644 --- a/testing/indexer-test-core/src/main/resources/testData/index_records_3.json +++ b/testing/indexer-test-core/src/main/resources/testData/index_records_3.json @@ -4,10 +4,19 @@ "data": { "WellName": "Data Platform Services - 51", "GeoShape": { - "type": "Point", - "coordinates": [ - -105.01621, - 39.57422 + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -105.01621, + 39.57422 + ] + } + } ] } } @@ -17,16 +26,25 @@ "data": { "WellName": "Data Platform Services - 52", "GeoShape": { - "type": "MultiPoint", - "coordinates": [ - [ - -105.01621, - 39.57422 - ], - [ - -80.666513, - 35.053994 - ] + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPoint", + "coordinates": [ + [ + -105.01621, + 39.57422 + ], + [ + -80.666513, + 35.053994 + ] + ] + } + } ] } } @@ -36,112 +54,121 @@ "data": { "WellName": "Data Platform Services - 53", "GeoShape": { - "type": "LineString", - "coordinates": [ - [ - -101.744384, - 39.32155 - ], - [ - -101.552124, - 39.330048 - ], - [ - -101.403808, - 39.330048 - ], - [ - -101.332397, - 39.364032 - ], - [ - -101.041259, - 39.368279 - ], - [ - -100.975341, - 39.304549 - ], - [ - -100.914916, - 39.245016 - ], - [ - -100.843505, - 39.164141 - ], - [ - -100.805053, - 39.104488 - ], - [ - -100.491943, - 39.100226 - ], - [ - -100.437011, - 39.095962 - ], - [ - -100.338134, - 39.095962 - ], - [ - -100.195312, - 39.027718 - ], - [ - -100.008544, - 39.010647 - ], - [ - -99.865722, - 39.00211 - ], - [ - -99.684448, - 38.972221 - ], - [ - -99.51416, - 38.929502 - ], - [ - -99.382324, - 38.920955 - ], - [ - -99.321899, - 38.895308 - ], - [ - -99.113159, - 38.869651 - ], - [ - -99.0802, - 38.85682 - ], - [ - -98.822021, - 38.85682 - ], - [ - -98.448486, - 38.848264 - ], - [ - -98.206787, - 38.848264 - ], - [ - -98.020019, - 38.878204 - ], - [ - -97.635498, - 38.873928 - ] + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -101.744384, + 39.32155 + ], + [ + -101.552124, + 39.330048 + ], + [ + -101.403808, + 39.330048 + ], + [ + -101.332397, + 39.364032 + ], + [ + -101.041259, + 39.368279 + ], + [ + -100.975341, + 39.304549 + ], + [ + -100.914916, + 39.245016 + ], + [ + -100.843505, + 39.164141 + ], + [ + -100.805053, + 39.104488 + ], + [ + -100.491943, + 39.100226 + ], + [ + -100.437011, + 39.095962 + ], + [ + -100.338134, + 39.095962 + ], + [ + -100.195312, + 39.027718 + ], + [ + -100.008544, + 39.010647 + ], + [ + -99.865722, + 39.00211 + ], + [ + -99.684448, + 38.972221 + ], + [ + -99.51416, + 38.929502 + ], + [ + -99.382324, + 38.920955 + ], + [ + -99.321899, + 38.895308 + ], + [ + -99.113159, + 38.869651 + ], + [ + -99.0802, + 38.85682 + ], + [ + -98.822021, + 38.85682 + ], + [ + -98.448486, + 38.848264 + ], + [ + -98.206787, + 38.848264 + ], + [ + -98.020019, + 38.878204 + ], + [ + -97.635498, + 38.873928 + ] + ] + } + } ] } } @@ -151,88 +178,97 @@ "data": { "WellName": "Data Platform Services - 54", "GeoShape": { - "type": "MultiLineString", - "coordinates": [ - [ - [ - -105.021443, - 39.578057 - ], - [ - -105.021507, - 39.577809 - ], - [ - -105.021572, - 39.577495 - ], - [ - -105.021572, - 39.577164 - ], - [ - -105.021572, - 39.577032 - ], - [ - -105.021529, - 39.576784 - ] - ], - [ - [ - -105.019898, - 39.574997 - ], - [ - -105.019598, - 39.574898 - ], - [ - -105.019061, - 39.574782 - ] - ], - [ - [ - -105.017173, - 39.574402 - ], - [ - -105.01698, - 39.574385 - ], - [ - -105.016636, - 39.574385 - ], - [ - -105.016508, - 39.574402 - ], - [ - -105.01595, - 39.57427 - ] - ], - [ - [ - -105.014276, - 39.573972 - ], - [ - -105.014126, - 39.574038 - ], - [ - -105.013825, - 39.57417 - ], - [ - -105.01331, - 39.574452 - ] - ] + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [ + -105.021443, + 39.578057 + ], + [ + -105.021507, + 39.577809 + ], + [ + -105.021572, + 39.577495 + ], + [ + -105.021572, + 39.577164 + ], + [ + -105.021572, + 39.577032 + ], + [ + -105.021529, + 39.576784 + ] + ], + [ + [ + -105.019898, + 39.574997 + ], + [ + -105.019598, + 39.574898 + ], + [ + -105.019061, + 39.574782 + ] + ], + [ + [ + -105.017173, + 39.574402 + ], + [ + -105.01698, + 39.574385 + ], + [ + -105.016636, + 39.574385 + ], + [ + -105.016508, + 39.574402 + ], + [ + -105.01595, + 39.57427 + ] + ], + [ + [ + -105.014276, + 39.573972 + ], + [ + -105.014126, + 39.574038 + ], + [ + -105.013825, + 39.57417 + ], + [ + -105.01331, + 39.574452 + ] + ] + ] + } + } ] } } @@ -242,30 +278,39 @@ "data": { "WellName": "Data Platform Services - 55", "GeoShape": { - "type": "Polygon", - "coordinates": [ - [ - [ - 100, - 0 - ], - [ - 101, - 0 - ], - [ - 101, - 1 - ], - [ - 100, - 1 - ], - [ - 100, - 0 - ] - ] + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100, + 0 + ], + [ + 101, + 0 + ], + [ + 101, + 1 + ], + [ + 100, + 1 + ], + [ + 100, + 0 + ] + ] + ] + } + } ] } } @@ -275,56 +320,65 @@ "data": { "WellName": "Data Platform Services - 56", "GeoShape": { - "type": "MultiPolygon", - "coordinates": [ - [ - [ - [ - 107, - 7 - ], - [ - 108, - 7 - ], - [ - 108, - 8 - ], - [ - 107, - 8 - ], - [ - 107, - 7 - ] - ] - ], - [ - [ - [ - 100, - 0 - ], - [ - 101, - 0 - ], - [ - 101, - 1 - ], - [ - 100, - 1 - ], - [ - 100, - 0 + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 107, + 7 + ], + [ + 108, + 7 + ], + [ + 108, + 8 + ], + [ + 107, + 8 + ], + [ + 107, + 7 + ] + ] + ], + [ + [ + [ + 100, + 0 + ], + [ + 101, + 0 + ], + [ + 101, + 1 + ], + [ + 100, + 1 + ], + [ + 100, + 0 + ] + ] + ] ] - ] - ] + } + } ] } } @@ -334,190 +388,199 @@ "data": { "WellName": "Data Platform Services - 57", "GeoShape": { - "type": "GeometryCollection", - "geometries": [ - { - "type": "Point", - "coordinates": [ - -80.660805, - 35.049392 - ] - }, - { - "type": "Polygon", - "coordinates": [ - [ - [ - -80.664582, - 35.044965 - ], - [ - -80.663874, - 35.04428 - ], - [ - -80.662586, - 35.04558 - ], - [ - -80.663444, - 35.046036 - ], - [ - -80.664582, - 35.044965 - ] - ] - ] - }, + "type": "FeatureCollection", + "features": [ { - "type": "LineString", - "coordinates": [ - [ - -80.662372, - 35.059509 - ], - [ - -80.662693, - 35.059263 - ], - [ - -80.662844, - 35.05893 - ], - [ - -80.66308, - 35.058332 - ], - [ - -80.663595, - 35.057753 - ], - [ - -80.663874, - 35.057401 - ], - [ - -80.66441, - 35.057033 - ], - [ - -80.664861, - 35.056787 - ], - [ - -80.665419, - 35.056506 - ], - [ - -80.665633, - 35.056312 - ], - [ - -80.666019, - 35.055891 - ], - [ - -80.666191, - 35.055452 - ], - [ - -80.666191, - 35.055171 - ], - [ - -80.666255, - 35.05489 - ], - [ - -80.666213, - 35.054222 - ], - [ - -80.666213, - 35.053924 - ], - [ - -80.665955, - 35.052905 - ], - [ - -80.665698, - 35.052044 - ], - [ - -80.665504, - 35.051482 - ], - [ - -80.665762, - 35.050481 - ], - [ - -80.66617, - 35.049725 - ], - [ - -80.666513, - 35.049286 - ], - [ - -80.666921, - 35.048531 - ], - [ - -80.667006, - 35.048215 - ], - [ - -80.667071, - 35.047775 - ], - [ - -80.667049, - 35.047389 - ], - [ - -80.666964, - 35.046985 - ], - [ - -80.666813, - 35.046353 - ], - [ - -80.666599, - 35.045966 - ], - [ - -80.666406, - 35.045615 - ], - [ - -80.665998, - 35.045193 - ], - [ - -80.665526, - 35.044877 - ], - [ - -80.664989, - 35.044543 - ], - [ - -80.664496, - 35.044174 - ], - [ - -80.663852, - 35.043876 - ], - [ - -80.663037, - 35.043717 + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { + "type": "Point", + "coordinates": [ + -80.660805, + 35.049392 + ] + }, + { + "type": "Polygon", + "coordinates": [ + [ + [ + -80.664582, + 35.044965 + ], + [ + -80.663874, + 35.04428 + ], + [ + -80.662586, + 35.04558 + ], + [ + -80.663444, + 35.046036 + ], + [ + -80.664582, + 35.044965 + ] + ] + ] + }, + { + "type": "LineString", + "coordinates": [ + [ + -80.662372, + 35.059509 + ], + [ + -80.662693, + 35.059263 + ], + [ + -80.662844, + 35.05893 + ], + [ + -80.66308, + 35.058332 + ], + [ + -80.663595, + 35.057753 + ], + [ + -80.663874, + 35.057401 + ], + [ + -80.66441, + 35.057033 + ], + [ + -80.664861, + 35.056787 + ], + [ + -80.665419, + 35.056506 + ], + [ + -80.665633, + 35.056312 + ], + [ + -80.666019, + 35.055891 + ], + [ + -80.666191, + 35.055452 + ], + [ + -80.666191, + 35.055171 + ], + [ + -80.666255, + 35.05489 + ], + [ + -80.666213, + 35.054222 + ], + [ + -80.666213, + 35.053924 + ], + [ + -80.665955, + 35.052905 + ], + [ + -80.665698, + 35.052044 + ], + [ + -80.665504, + 35.051482 + ], + [ + -80.665762, + 35.050481 + ], + [ + -80.66617, + 35.049725 + ], + [ + -80.666513, + 35.049286 + ], + [ + -80.666921, + 35.048531 + ], + [ + -80.667006, + 35.048215 + ], + [ + -80.667071, + 35.047775 + ], + [ + -80.667049, + 35.047389 + ], + [ + -80.666964, + 35.046985 + ], + [ + -80.666813, + 35.046353 + ], + [ + -80.666599, + 35.045966 + ], + [ + -80.666406, + 35.045615 + ], + [ + -80.665998, + 35.045193 + ], + [ + -80.665526, + 35.044877 + ], + [ + -80.664989, + 35.044543 + ], + [ + -80.664496, + 35.044174 + ], + [ + -80.663852, + 35.043876 + ], + [ + -80.663037, + 35.043717 + ] + ] + } ] - ] + } } ] } diff --git a/testing/indexer-test-core/src/main/resources/testData/index_records_3.schema.json b/testing/indexer-test-core/src/main/resources/testData/index_records_3.schema.json index bb5d2e9c5ce9fd0a376f6849028007b6d912da60..87bc4b647523c6ac0ab810853a94c3f0dba54976 100644 --- a/testing/indexer-test-core/src/main/resources/testData/index_records_3.schema.json +++ b/testing/indexer-test-core/src/main/resources/testData/index_records_3.schema.json @@ -2,11 +2,11 @@ "schemaInfo": { "schemaIdentity": { "authority": "tenant1", - "source": "indexer-int-test", - "entityType": "sample-schema-3", - "schemaVersionMajor": "1", + "source": "indexer", + "entityType": "test-data--Integration", + "schemaVersionMajor": "3", "schemaVersionMinor": "0", - "schemaVersionPatch": "4" + "schemaVersionPatch": "0" }, "status": "DEVELOPMENT" }, @@ -18,7 +18,7 @@ "type": "object", "properties": { "GeoShape": { - "$ref": "#/definitions/geoJsonFeatureCollection", + "$ref": "#/definitions/opendes:wks:AbstractFeatureCollection:1.0.0", "description": "The wellbore's position .", "format": "core:dl:geopoint:1.0.0", "title": "WGS 84 Position", @@ -31,6 +31,533 @@ } ] } + }, + "definitions": { + "opendes:wks:AbstractFeatureCollection:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractFeatureCollection:1.0.0", + "description": "GeoJSON feature collection as originally published in https://geojson.org/schema/FeatureCollection.json. Attention: the coordinate order is fixed: Longitude first, followed by Latitude, optionally height above MSL (EPSG:5714) as third coordinate.", + "title": "GeoJSON FeatureCollection", + "type": "object", + "required": [ + "type", + "features" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "FeatureCollection" + ] + }, + "features": { + "type": "array", + "items": { + "title": "GeoJSON Feature", + "type": "object", + "required": [ + "type", + "properties", + "geometry" + ], + "properties": { + "geometry": { + "oneOf": [ + { + "type": "null" + }, + { + "title": "GeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "type": { + "type": "string", + "enum": [ + "Point" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "LineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "Polygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON GeometryCollection", + "type": "object", + "required": [ + "type", + "geometries" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "GeometryCollection" + ] + }, + "geometries": { + "type": "array", + "items": { + "oneOf": [ + { + "title": "GeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "type": { + "type": "string", + "enum": [ + "Point" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "LineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "Polygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + ] + } + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + ] + }, + "type": { + "type": "string", + "enum": [ + "Feature" + ] + }, + "properties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object" + } + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractFeatureCollection.1.0.0.json" + } } } } \ No newline at end of file diff --git a/testing/indexer-test-core/src/main/resources/testData/r3-index_record_wks_master.json b/testing/indexer-test-core/src/main/resources/testData/r3-index_record_wks_master.json new file mode 100644 index 0000000000000000000000000000000000000000..de6e08dab7f12b7dc2fdc4a8108b87692694a9cb --- /dev/null +++ b/testing/indexer-test-core/src/main/resources/testData/r3-index_record_wks_master.json @@ -0,0 +1,143 @@ +[ + { + "id": "tenant1:<kindSubType>:testIngest61<timestamp>", + "data": { + "NameAliases": [ + { + "AliasName": "1001", + "AliasNameTypeID": "osdu:reference-data--AliasNameType:UWI:" + }, + { + "AliasName": "AHM-01", + "AliasNameTypeID": "osdu:reference-data--AliasNameType:Borehole%20Code:" + }, + { + "AliasName": "ARNHEM-01", + "AliasNameTypeID": "osdu:reference-data--AliasNameType:Borehole:" + } + ], + "GeoContexts": [ + { + "GeoPoliticalEntityID": "osdu:master-data--GeoPoliticalEntity:Gelderland:", + "GeoTypeID": "osdu:reference-data--GeoPoliticalEntityType:Province:" + }, + { + "GeoPoliticalEntityID": "osdu:master-data--GeoPoliticalEntity:Lingewaard:", + "GeoTypeID": "osdu:reference-data--GeoPoliticalEntityType:Municipality:" + } + ], + "SpatialLocation": { + "AsIngestedCoordinates": { + "type": "AnyCrsFeatureCollection", + "CoordinateReferenceSystemID": "osdu:reference-data--CoordinateReferenceSystem:ED_1950_UTM_Zone_31N:", + "features": [ + { + "type": "AnyCrsFeature", + "geometry": { + "type": "AnyCrsPoint", + "coordinates": [ + 700113.0, + 5757315.0 + ] + }, + "properties": {} + } + ], + "persistableReferenceCrs": "" + }, + "Wgs84Coordinates": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ + 5.90929597, + 51.92868061 + ] + }, + "properties": {} + } + ] + } + }, + "InitialOperatorID": "osdu:master-data--Organisation:Bataafse%20Petroleum%20Maatschappij:", + "CurrentOperatorID": "osdu:master-data--Organisation:Nederlandse%20Aardolie%20Maatschappij%20B.V.:", + "OperatingEnvironmentID": "osdu:reference-data--OperatingEnvironment:ON:", + "FacilityStates": [ + { + "FacilityStateTypeID": "osdu:reference-data--FacilityStateType:Abandoned:" + } + ], + "FacilityEvents": [ + { + "FacilityEventTypeID": "osdu:reference-data--FacilityEventType:Drilling%20Start:", + "EffectiveDateTime": "1944-03-01T00:00:00" + }, + { + "FacilityEventTypeID": "osdu:reference-data--FacilityEventType:Drilling%20Finish:", + "EffectiveDateTime": "1944-10-02T00:00:00" + } + ], + "WellID": "osdu:master-data--Well:1001:", + "SequenceNumber": 1, + "VerticalMeasurements": [ + { + "VerticalMeasurementID": "TD-Original", + "VerticalMeasurement": 662.0, + "VerticalMeasurementTypeID": "osdu:reference-data--VerticalMeasurementType:Total%20Depth:", + "VerticalMeasurementPathID": "osdu:reference-data--VerticalMeasurementPath:Measured%20Depth:", + "VerticalMeasurementUnitOfMeasureID": "osdu:reference-data--UnitOfMeasure:M:", + "VerticalReferenceID": "Measured_From" + }, + { + "VerticalMeasurementID": "TVD", + "VerticalMeasurement": 662.0, + "VerticalMeasurementTypeID": "osdu:reference-data--VerticalMeasurementType:TD:", + "VerticalMeasurementPathID": "osdu:reference-data--VerticalMeasurementPath:True%20Vertical%20Depth:", + "VerticalMeasurementUnitOfMeasureID": "osdu:reference-data--UnitOfMeasure:M:", + "VerticalReferenceID": "Measured_From" + }, + { + "VerticalMeasurementID": "Measured_From", + "VerticalMeasurement": 11.01, + "VerticalMeasurementTypeID": "osdu:reference-data--VerticalMeasurementType:Rotary%20Table:", + "VerticalMeasurementPathID": "osdu:reference-data--VerticalMeasurementPath:Elevation:", + "VerticalMeasurementUnitOfMeasureID": "osdu:reference-data--UnitOfMeasure:M:", + "VerticalCRSID": "osdu:reference-data--CoordinateReferenceSystem:NAP:" + } + ], + "DrillingReasons": [ + { + "DrillingReasonTypeID": "osdu:reference-data--DrillingReasonType:EXP-HC:" + }, + { + "DrillingReasonTypeID": "osdu:reference-data--DrillingReasonType:Exploratie%20koolwaterstof:" + } + ], + "TrajectoryTypeID": "osdu:reference-data--WellboreTrajectoryType:Vertikaal:", + "PrimaryMaterialID": "osdu:reference-data--MaterialType:OIL:", + "ProjectedBottomHoleLocation": { + "AsIngestedCoordinates": { + "type": "AnyCrsFeatureCollection", + "CoordinateReferenceSystemID": "osdu:reference-data--CoordinateReferenceSystem:ED_1950_UTM_Zone_31N:", + "features": [ + { + "type": "AnyCrsFeature", + "geometry": { + "type": "AnyCrsPoint", + "coordinates": [ + 700113.0, + 5757315.0 + ] + }, + "properties": {} + } + ], + "persistableReferenceCrs": "" + } + } + } + } +] \ No newline at end of file diff --git a/testing/indexer-test-core/src/main/resources/testData/r3-index_record_wks_master.schema.json b/testing/indexer-test-core/src/main/resources/testData/r3-index_record_wks_master.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..0d69ae534698474cac255148334f09da4c08551e --- /dev/null +++ b/testing/indexer-test-core/src/main/resources/testData/r3-index_record_wks_master.schema.json @@ -0,0 +1,2012 @@ +{ + "schemaInfo": { + "schemaIdentity": { + "authority": "tenant1", + "source": "wks", + "entityType": "master-data--Wellbore", + "schemaVersionMajor": "2", + "schemaVersionMinor": "0", + "schemaVersionPatch": "3" + }, + "status": "DEVELOPMENT" + }, + "schema": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:master-data--Test:1.0.0", + "description": "Enter a meaningful description for Test.", + "title": "Test", + "type": "object", + "x-osdu-review-status": "Pending", + "required": [ + "kind", + "acl", + "legal" + ], + "additionalProperties": false, + "definitions": { + "opendes:wks:AbstractGeoPoliticalContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoPoliticalContext:1.0.0", + "description": "A single, typed geo-political entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", + "x-osdu-review-status": "Accepted", + "title": "AbstractGeoPoliticalContext", + "type": "object", + "properties": { + "GeoPoliticalEntityID": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-GeoPoliticalEntity:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Reference to GeoPoliticalEntity.", + "x-osdu-relationship": [ + { + "EntityType": "GeoPoliticalEntity", + "GroupType": "master-data" + } + ], + "type": "string" + }, + "GeoTypeID": { + "x-osdu-is-derived": { + "RelationshipPropertyName": "GeoPoliticalEntityID", + "TargetPropertyName": "GeoPoliticalEntityTypeID" + }, + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-GeoPoliticalEntityType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The GeoPoliticalEntityType reference of the GeoPoliticalEntity (via GeoPoliticalEntityID) for application convenience.", + "x-osdu-relationship": [ + { + "EntityType": "GeoPoliticalEntityType", + "GroupType": "reference-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoPoliticalContext.1.0.0.json" + }, + "opendes:wks:AbstractCommonResources:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractCommonResources:1.0.0", + "description": "Common resources to be injected at root 'data' level for every entity, which is persistable in Storage. The insertion is performed by the OsduSchemaComposer script.", + "title": "OSDU Common Resources", + "type": "object", + "properties": { + "ResourceHomeRegionID": { + "x-osdu-relationship": [ + { + "EntityType": "OSDURegion", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-OSDURegion:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The name of the home [cloud environment] region for this OSDU resource object.", + "title": "Resource Home Region ID", + "type": "string" + }, + "ResourceHostRegionIDs": { + "description": "The name of the host [cloud environment] region(s) for this OSDU resource object.", + "title": "Resource Host Region ID", + "type": "array", + "items": { + "x-osdu-relationship": [ + { + "EntityType": "OSDURegion", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-OSDURegion:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "type": "string" + } + }, + "ResourceLifecycleStatus": { + "x-osdu-relationship": [ + { + "EntityType": "ResourceLifecycleStatus", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-ResourceLifecycleStatus:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Describes the current Resource Lifecycle status.", + "title": "Resource Lifecycle Status", + "type": "string" + }, + "ResourceSecurityClassification": { + "x-osdu-relationship": [ + { + "EntityType": "ResourceSecurityClassification", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-ResourceSecurityClassification:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Classifies the security level of the resource.", + "title": "Resource Security Classification", + "type": "string" + }, + "ResourceCurationStatus": { + "x-osdu-relationship": [ + { + "EntityType": "ResourceCurationStatus", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-ResourceCurationStatus:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Describes the current Curation status.", + "title": "Resource Curation Status", + "type": "string" + }, + "ExistenceKind": { + "x-osdu-relationship": [ + { + "EntityType": "ExistenceKind", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-ExistenceKind:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Where does this data resource sit in the cradle-to-grave span of its existence?", + "title": "Existence Kind", + "type": "string" + }, + "Source": { + "description": "The entity that produced the record, or from which it is received; could be an organization, agency, system, internal team, or individual. For informational purposes only, the list of sources is not governed.", + "title": "Data Source", + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractCommonResources.1.0.0.json" + }, + "opendes:wks:AbstractAliasNames:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractAliasNames:1.0.0", + "description": "A list of alternative names for an object. The preferred name is in a separate, scalar property. It may or may not be repeated in the alias list, though a best practice is to include it if the list is present, but to omit the list if there are no other names. Note that the abstract entity is an array so the $ref to it is a simple property reference.", + "x-osdu-review-status": "Accepted", + "title": "AbstractAliasNames", + "type": "object", + "properties": { + "AliasNameTypeID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-AliasNameType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "A classification of alias names such as by role played or type of source, such as regulatory name, regulatory code, company code, international standard name, etc.", + "x-osdu-relationship": [ + { + "EntityType": "AliasNameType", + "GroupType": "reference-data" + } + ], + "type": "string" + }, + "EffectiveDateTime": { + "format": "date-time", + "type": "string", + "description": "The date and time when an alias name becomes effective." + }, + "AliasName": { + "type": "string", + "description": "Alternative Name value of defined name type for an object." + }, + "TerminationDateTime": { + "format": "date-time", + "type": "string", + "description": "The data and time when an alias name is no longer in effect." + }, + "DefinitionOrganisationID": { + "pattern": "^[\\w\\-\\.]+:(reference-data\\-\\-StandardsOrganisation|master-data\\-\\-Organisation):[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The StandardsOrganisation (reference-data) or Organisation (master-data) that provided the name (the source).", + "x-osdu-relationship": [ + { + "EntityType": "StandardsOrganisation", + "GroupType": "reference-data" + }, + { + "EntityType": "Organisation", + "GroupType": "master-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractAliasNames.1.0.0.json" + }, + "opendes:wks:AbstractAnyCrsFeatureCollection:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractAnyCrsFeatureCollection:1.0.0", + "description": "A schema like GeoJSON FeatureCollection with a non-WGS 84 CRS context; based on https://geojson.org/schema/FeatureCollection.json. Attention: the coordinate order is fixed: Longitude/Easting/Westing/X first, followed by Latitude/Northing/Southing/Y, optionally height as third coordinate.", + "title": "AbstractAnyCrsFeatureCollection", + "type": "object", + "required": [ + "type", + "persistableReferenceCrs", + "features" + ], + "properties": { + "CoordinateReferenceSystemID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-CoordinateReferenceSystem:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The CRS reference into the CoordinateReferenceSystem catalog.", + "x-osdu-relationship": [ + { + "EntityType": "CoordinateReferenceSystem", + "GroupType": "reference-data" + } + ], + "title": "Coordinate Reference System ID", + "type": "string", + "example": "namespace:reference-data--CoordinateReferenceSystem:BoundCRS.SLB.32021.15851:" + }, + "persistableReferenceCrs": { + "description": "The CRS reference as persistableReference string. If populated, the CoordinateReferenceSystemID takes precedence.", + "type": "string", + "title": "CRS Reference", + "example": "{\"lateBoundCRS\":{\"wkt\":\"PROJCS[\\\"NAD_1927_StatePlane_North_Dakota_South_FIPS_3302\\\",GEOGCS[\\\"GCS_North_American_1927\\\",DATUM[\\\"D_North_American_1927\\\",SPHEROID[\\\"Clarke_1866\\\",6378206.4,294.9786982]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],PROJECTION[\\\"Lambert_Conformal_Conic\\\"],PARAMETER[\\\"False_Easting\\\",2000000.0],PARAMETER[\\\"False_Northing\\\",0.0],PARAMETER[\\\"Central_Meridian\\\",-100.5],PARAMETER[\\\"Standard_Parallel_1\\\",46.1833333333333],PARAMETER[\\\"Standard_Parallel_2\\\",47.4833333333333],PARAMETER[\\\"Latitude_Of_Origin\\\",45.6666666666667],UNIT[\\\"Foot_US\\\",0.304800609601219],AUTHORITY[\\\"EPSG\\\",32021]]\",\"ver\":\"PE_10_3_1\",\"name\":\"NAD_1927_StatePlane_North_Dakota_South_FIPS_3302\",\"authCode\":{\"auth\":\"EPSG\",\"code\":\"32021\"},\"type\":\"LBC\"},\"singleCT\":{\"wkt\":\"GEOGTRAN[\\\"NAD_1927_To_WGS_1984_79_CONUS\\\",GEOGCS[\\\"GCS_North_American_1927\\\",DATUM[\\\"D_North_American_1927\\\",SPHEROID[\\\"Clarke_1866\\\",6378206.4,294.9786982]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],GEOGCS[\\\"GCS_WGS_1984\\\",DATUM[\\\"D_WGS_1984\\\",SPHEROID[\\\"WGS_1984\\\",6378137.0,298.257223563]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],METHOD[\\\"NADCON\\\"],PARAMETER[\\\"Dataset_conus\\\",0.0],AUTHORITY[\\\"EPSG\\\",15851]]\",\"ver\":\"PE_10_3_1\",\"name\":\"NAD_1927_To_WGS_1984_79_CONUS\",\"authCode\":{\"auth\":\"EPSG\",\"code\":\"15851\"},\"type\":\"ST\"},\"ver\":\"PE_10_3_1\",\"name\":\"NAD27 * OGP-Usa Conus / North Dakota South [32021,15851]\",\"authCode\":{\"auth\":\"SLB\",\"code\":\"32021079\"},\"type\":\"EBC\"}" + }, + "features": { + "type": "array", + "items": { + "title": "AnyCrsGeoJSON Feature", + "type": "object", + "required": [ + "type", + "properties", + "geometry" + ], + "properties": { + "geometry": { + "oneOf": [ + { + "type": "null" + }, + { + "title": "AnyCrsGeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON GeometryCollection", + "type": "object", + "required": [ + "type", + "geometries" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "AnyCrsGeometryCollection" + ] + }, + "geometries": { + "type": "array", + "items": { + "oneOf": [ + { + "title": "AnyCrsGeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "AnyCrsGeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsMultiPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + ] + } + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + ] + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsFeature" + ] + }, + "properties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object" + } + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "persistableReferenceUnitZ": { + "description": "The unit of measure for the Z-axis (only for 3-dimensional coordinates, where the CRS does not describe the vertical unit). Note that the direction is upwards positive, i.e. Z means height.", + "type": "string", + "title": "Z-Unit Reference", + "example": "{\"scaleOffset\":{\"scale\":1.0,\"offset\":0.0},\"symbol\":\"m\",\"baseMeasurement\":{\"ancestry\":\"Length\",\"type\":\"UM\"},\"type\":\"USO\"}" + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + }, + "persistableReferenceVerticalCrs": { + "description": "The VerticalCRS reference as persistableReference string. If populated, the VerticalCoordinateReferenceSystemID takes precedence. The property is null or empty for 2D geometries. For 3D geometries and absent or null persistableReferenceVerticalCrs the vertical CRS is either provided via persistableReferenceCrs's CompoundCRS or it is implicitly defined as EPSG:5714 MSL height.", + "type": "string", + "title": "Vertical CRS Reference", + "example": "{\"authCode\":{\"auth\":\"EPSG\",\"code\":\"5773\"},\"type\":\"LBC\",\"ver\":\"PE_10_3_1\",\"name\":\"EGM96_Geoid\",\"wkt\":\"VERTCS[\\\"EGM96_Geoid\\\",VDATUM[\\\"EGM96_Geoid\\\"],PARAMETER[\\\"Vertical_Shift\\\",0.0],PARAMETER[\\\"Direction\\\",1.0],UNIT[\\\"Meter\\\",1.0],AUTHORITY[\\\"EPSG\\\",5773]]\"}" + }, + "type": { + "type": "string", + "enum": [ + "AnyCrsFeatureCollection" + ] + }, + "VerticalCoordinateReferenceSystemID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-CoordinateReferenceSystem:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The explicit VerticalCRS reference into the CoordinateReferenceSystem catalog. This property stays empty for 2D geometries. Absent or empty values for 3D geometries mean the context may be provided by a CompoundCRS in 'CoordinateReferenceSystemID' or implicitly EPSG:5714 MSL height", + "x-osdu-relationship": [ + { + "EntityType": "CoordinateReferenceSystem", + "GroupType": "reference-data" + } + ], + "title": "Vertical Coordinate Reference System ID", + "type": "string", + "example": "namespace:reference-data--CoordinateReferenceSystem:VerticalCRS.EPSG.5773:" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractAnyCrsFeatureCollection.1.0.0.json" + }, + "opendes:wks:AbstractMetaItem:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "oneOf": [ + { + "title": "FrameOfReferenceUOM", + "type": "object", + "properties": { + "persistableReference": { + "description": "The self-contained, persistable reference string uniquely identifying the Unit.", + "title": "UOM Persistable Reference", + "type": "string", + "example": "{\"abcd\":{\"a\":0.0,\"b\":1200.0,\"c\":3937.0,\"d\":0.0},\"symbol\":\"ft[US]\",\"baseMeasurement\":{\"ancestry\":\"L\",\"type\":\"UM\"},\"type\":\"UAD\"}" + }, + "kind": { + "const": "Unit", + "description": "The kind of reference, 'Unit' for FrameOfReferenceUOM.", + "title": "UOM Reference Kind" + }, + "propertyNames": { + "description": "The list of property names, to which this meta data item provides Unit context to. Data structures, which come in a single frame of reference, can register the property name, others require a full path like \"Data.StructureA.PropertyB\" to define a unique context.", + "title": "UOM Property Names", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "HorizontalDeflection.EastWest", + "HorizontalDeflection.NorthSouth" + ] + }, + "name": { + "description": "The unit symbol or name of the unit.", + "title": "UOM Unit Symbol", + "type": "string", + "example": "ft[US]" + }, + "unitOfMeasureID": { + "x-osdu-relationship": [ + { + "EntityType": "UnitOfMeasure", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-UnitOfMeasure:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "SRN to unit of measure reference.", + "type": "string", + "example": "namespace:reference-data--UnitOfMeasure:ftUS:" + } + }, + "required": [ + "kind", + "persistableReference" + ] + }, + { + "title": "FrameOfReferenceCRS", + "type": "object", + "properties": { + "coordinateReferenceSystemID": { + "x-osdu-relationship": [ + { + "EntityType": "CoordinateReferenceSystem", + "GroupType": "reference-data" + } + ], + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-CoordinateReferenceSystem:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "SRN to CRS reference.", + "type": "string", + "example": "namespace:reference-data--CoordinateReferenceSystem:EPSG.32615:" + }, + "persistableReference": { + "description": "The self-contained, persistable reference string uniquely identifying the CRS.", + "title": "CRS Persistable Reference", + "type": "string", + "example": "{\"authCode\":{\"auth\":\"EPSG\",\"code\":\"32615\"},\"type\":\"LBC\",\"ver\":\"PE_10_3_1\",\"name\":\"WGS_1984_UTM_Zone_15N\",\"wkt\":\"PROJCS[\\\"WGS_1984_UTM_Zone_15N\\\",GEOGCS[\\\"GCS_WGS_1984\\\",DATUM[\\\"D_WGS_1984\\\",SPHEROID[\\\"WGS_1984\\\",6378137.0,298.257223563]],PRIMEM[\\\"Greenwich\\\",0.0],UNIT[\\\"Degree\\\",0.0174532925199433]],PROJECTION[\\\"Transverse_Mercator\\\"],PARAMETER[\\\"False_Easting\\\",500000.0],PARAMETER[\\\"False_Northing\\\",0.0],PARAMETER[\\\"Central_Meridian\\\",-93.0],PARAMETER[\\\"Scale_Factor\\\",0.9996],PARAMETER[\\\"Latitude_Of_Origin\\\",0.0],UNIT[\\\"Meter\\\",1.0],AUTHORITY[\\\"EPSG\\\",32615]]\"}" + }, + "kind": { + "const": "CRS", + "description": "The kind of reference, constant 'CRS' for FrameOfReferenceCRS.", + "title": "CRS Reference Kind" + }, + "propertyNames": { + "description": "The list of property names, to which this meta data item provides CRS context to. Data structures, which come in a single frame of reference, can register the property name, others require a full path like \"Data.StructureA.PropertyB\" to define a unique context.", + "title": "CRS Property Names", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "KickOffPosition.X", + "KickOffPosition.Y" + ] + }, + "name": { + "description": "The name of the CRS.", + "title": "CRS Name", + "type": "string", + "example": "NAD27 * OGP-Usa Conus / North Dakota South [32021,15851]" + } + }, + "required": [ + "kind", + "persistableReference" + ] + }, + { + "title": "FrameOfReferenceDateTime", + "type": "object", + "properties": { + "persistableReference": { + "description": "The self-contained, persistable reference string uniquely identifying DateTime reference.", + "title": "DateTime Persistable Reference", + "type": "string", + "example": "{\"format\":\"yyyy-MM-ddTHH:mm:ssZ\",\"timeZone\":\"UTC\",\"type\":\"DTM\"}" + }, + "kind": { + "const": "DateTime", + "description": "The kind of reference, constant 'DateTime', for FrameOfReferenceDateTime.", + "title": "DateTime Reference Kind" + }, + "propertyNames": { + "description": "The list of property names, to which this meta data item provides DateTime context to. Data structures, which come in a single frame of reference, can register the property name, others require a full path like \"Data.StructureA.PropertyB\" to define a unique context.", + "title": "DateTime Property Names", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "Acquisition.StartTime", + "Acquisition.EndTime" + ] + }, + "name": { + "description": "The name of the DateTime format and reference.", + "title": "DateTime Name", + "type": "string", + "example": "UTC" + } + }, + "required": [ + "kind", + "persistableReference" + ] + }, + { + "title": "FrameOfReferenceAzimuthReference", + "type": "object", + "properties": { + "persistableReference": { + "description": "The self-contained, persistable reference string uniquely identifying AzimuthReference.", + "title": "AzimuthReference Persistable Reference", + "type": "string", + "example": "{\"code\":\"TrueNorth\",\"type\":\"AZR\"}" + }, + "kind": { + "const": "AzimuthReference", + "description": "The kind of reference, constant 'AzimuthReference', for FrameOfReferenceAzimuthReference.", + "title": "AzimuthReference Reference Kind" + }, + "propertyNames": { + "description": "The list of property names, to which this meta data item provides AzimuthReference context to. Data structures, which come in a single frame of reference, can register the property name, others require a full path like \"Data.StructureA.PropertyB\" to define a unique context.", + "title": "AzimuthReference Property Names", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "Bearing" + ] + }, + "name": { + "description": "The name of the CRS or the symbol/name of the unit.", + "title": "AzimuthReference Name", + "type": "string", + "example": "TrueNorth" + } + }, + "required": [ + "kind", + "persistableReference" + ] + } + ], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractMetaItem:1.0.0", + "description": "A meta data item, which allows the association of named properties or property values to a Unit/Measurement/CRS/Azimuth/Time context.", + "title": "Frame of Reference Meta Data Item", + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractMetaItem.1.0.0.json" + }, + "opendes:wks:AbstractGeoContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "oneOf": [ + { + "$ref": "#/definitions/opendes:wks:AbstractGeoPoliticalContext:1.0.0" + }, + { + "$ref": "#/definitions/opendes:wks:AbstractGeoBasinContext:1.0.0" + }, + { + "$ref": "#/definitions/opendes:wks:AbstractGeoFieldContext:1.0.0" + }, + { + "$ref": "#/definitions/opendes:wks:AbstractGeoPlayContext:1.0.0" + }, + { + "$ref": "#/definitions/opendes:wks:AbstractGeoProspectContext:1.0.0" + } + ], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoContext:1.0.0", + "description": "A geographic context to an entity. It can be either a reference to a GeoPoliticalEntity, Basin, Field, Play or Prospect.", + "title": "AbstractGeoContext", + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoContext.1.0.0.json" + }, + "opendes:wks:AbstractLegalTags:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractLegalTags:1.0.0", + "description": "Legal meta data like legal tags, relevant other countries, legal status. This structure is included by the SystemProperties \"legal\", which is part of all OSDU records. Not extensible.", + "additionalProperties": false, + "title": "Legal Meta Data", + "type": "object", + "properties": { + "legaltags": { + "description": "The list of legal tags, which resolve to legal properties (like country of origin, export classification code, etc.) and rules with the help of the Compliance Service.", + "title": "Legal Tags", + "type": "array", + "items": { + "type": "string" + } + }, + "otherRelevantDataCountries": { + "description": "The list of other relevant data countries as an array of two-letter country codes, see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2.", + "title": "Other Relevant Data Countries", + "type": "array", + "items": { + "pattern": "^[A-Z]{2}$", + "type": "string" + } + }, + "status": { + "pattern": "^(compliant|uncompliant)$", + "description": "The legal status. Set by the system after evaluation against the compliance rules associated with the \"legaltags\" using the Compliance Service.", + "title": "Legal Status", + "type": "string" + } + }, + "required": [ + "legaltags", + "otherRelevantDataCountries" + ], + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractLegalTags.1.0.0.json" + }, + "opendes:wks:AbstractGeoBasinContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoBasinContext:1.0.0", + "description": "A single, typed basin entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", + "x-osdu-review-status": "Accepted", + "title": "AbstractGeoBasinContext", + "type": "object", + "properties": { + "BasinID": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-Basin:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Reference to Basin.", + "x-osdu-relationship": [ + { + "EntityType": "Basin", + "GroupType": "master-data" + } + ], + "type": "string" + }, + "GeoTypeID": { + "x-osdu-is-derived": { + "RelationshipPropertyName": "BasinID", + "TargetPropertyName": "BasinTypeID" + }, + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-BasinType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The BasinType reference of the Basin (via BasinID) for application convenience.", + "x-osdu-relationship": [ + { + "EntityType": "BasinType", + "GroupType": "reference-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoBasinContext.1.0.0.json" + }, + "opendes:wks:AbstractMaster:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractMaster:1.0.0", + "description": "Properties shared with all master-data schema instances.", + "x-osdu-review-status": "Accepted", + "title": "Abstract Master", + "type": "object", + "properties": { + "NameAliases": { + "description": "Alternative names, including historical, by which this master data is/has been known (it should include all the identifiers).", + "type": "array", + "items": { + "$ref": "#/definitions/opendes:wks:AbstractAliasNames:1.0.0" + } + }, + "SpatialLocation": { + "description": "The spatial location information such as coordinates, CRS information (left empty when not appropriate).", + "$ref": "#/definitions/opendes:wks:AbstractSpatialLocation:1.0.0" + }, + "VersionCreationReason": { + "description": "This describes the reason that caused the creation of a new version of this master data.", + "type": "string" + }, + "GeoContexts": { + "description": "List of geographic entities which provide context to the master data. This may include multiple types or multiple values of the same type.", + "type": "array", + "items": { + "$ref": "#/definitions/opendes:wks:AbstractGeoContext:1.0.0" + } + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractMaster.1.0.0.json" + }, + "opendes:wks:AbstractGeoProspectContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoProspectContext:1.0.0", + "description": "A single, typed Prospect entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", + "x-osdu-review-status": "Accepted", + "title": "AbstractGeoProspectContext", + "type": "object", + "properties": { + "ProspectID": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-Prospect:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Reference to the prospect.", + "x-osdu-relationship": [ + { + "EntityType": "Prospect", + "GroupType": "master-data" + } + ], + "type": "string" + }, + "GeoTypeID": { + "x-osdu-is-derived": { + "RelationshipPropertyName": "ProspectID", + "TargetPropertyName": "ProspectTypeID" + }, + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-ProspectType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The ProspectType reference of the Prospect (via ProspectID) for application convenience.", + "x-osdu-relationship": [ + { + "EntityType": "ProspectType", + "GroupType": "reference-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoProspectContext.1.0.0.json" + }, + "opendes:wks:AbstractSpatialLocation:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractSpatialLocation:1.0.0", + "description": "A geographic object which can be described by a set of points.", + "title": "AbstractSpatialLocation", + "type": "object", + "properties": { + "AsIngestedCoordinates": { + "description": "The original or 'as ingested' coordinates (Point, MultiPoint, LineString, MultiLineString, Polygon or MultiPolygon). The name 'AsIngestedCoordinates' was chosen to contrast it to 'OriginalCoordinates', which carries the uncertainty whether any coordinate operations took place before ingestion. In cases where the original CRS is different from the as-ingested CRS, the OperationsApplied can also contain the list of operations applied to the coordinate prior to ingestion. The data structure is similar to GeoJSON FeatureCollection, however in a CRS context explicitly defined within the AbstractAnyCrsFeatureCollection. The coordinate sequence follows GeoJSON standard, i.e. 'eastward/longitude', 'northward/latitude' {, 'upward/height' unless overridden by an explicit direction in the AsIngestedCoordinates.VerticalCoordinateReferenceSystemID}.", + "x-osdu-frame-of-reference": "CRS:", + "title": "As Ingested Coordinates", + "$ref": "#/definitions/opendes:wks:AbstractAnyCrsFeatureCollection:1.0.0" + }, + "SpatialParameterTypeID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-SpatialParameterType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "A type of spatial representation of an object, often general (e.g. an Outline, which could be applied to Field, Reservoir, Facility, etc.) or sometimes specific (e.g. Onshore Outline, State Offshore Outline, Federal Offshore Outline, 3 spatial representations that may be used by Countries).", + "x-osdu-relationship": [ + { + "EntityType": "SpatialParameterType", + "GroupType": "reference-data" + } + ], + "type": "string" + }, + "QuantitativeAccuracyBandID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-QuantitativeAccuracyBand:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "An approximate quantitative assessment of the quality of a location (accurate to > 500 m (i.e. not very accurate)), to < 1 m, etc.", + "x-osdu-relationship": [ + { + "EntityType": "QuantitativeAccuracyBand", + "GroupType": "reference-data" + } + ], + "type": "string" + }, + "CoordinateQualityCheckRemarks": { + "type": "array", + "description": "Freetext remarks on Quality Check.", + "items": { + "type": "string" + } + }, + "AppliedOperations": { + "description": "The audit trail of operations applied to the coordinates from the original state to the current state. The list may contain operations applied prior to ingestion as well as the operations applied to produce the Wgs84Coordinates. The text elements refer to ESRI style CRS and Transformation names, which may have to be translated to EPSG standard names.", + "title": "Operations Applied", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "conversion from ED_1950_UTM_Zone_31N to GCS_European_1950; 1 points converted", + "transformation GCS_European_1950 to GCS_WGS_1984 using ED_1950_To_WGS_1984_24; 1 points successfully transformed" + ] + }, + "QualitativeSpatialAccuracyTypeID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-QualitativeSpatialAccuracyType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "A qualitative description of the quality of a spatial location, e.g. unverifiable, not verified, basic validation.", + "x-osdu-relationship": [ + { + "EntityType": "QualitativeSpatialAccuracyType", + "GroupType": "reference-data" + } + ], + "type": "string" + }, + "CoordinateQualityCheckPerformedBy": { + "type": "string", + "description": "The user who performed the Quality Check." + }, + "SpatialLocationCoordinatesDate": { + "format": "date-time", + "description": "Date when coordinates were measured or retrieved.", + "x-osdu-frame-of-reference": "DateTime", + "type": "string" + }, + "CoordinateQualityCheckDateTime": { + "format": "date-time", + "description": "The date of the Quality Check.", + "x-osdu-frame-of-reference": "DateTime", + "type": "string" + }, + "Wgs84Coordinates": { + "title": "WGS 84 Coordinates", + "description": "The normalized coordinates (Point, MultiPoint, LineString, MultiLineString, Polygon or MultiPolygon) based on WGS 84 (EPSG:4326 for 2-dimensional coordinates, EPSG:4326 + EPSG:5714 (MSL) for 3-dimensional coordinates). This derived coordinate representation is intended for global discoverability only. The schema of this substructure is identical to the GeoJSON FeatureCollection https://geojson.org/schema/FeatureCollection.json. The coordinate sequence follows GeoJSON standard, i.e. longitude, latitude {, height}", + "$ref": "#/definitions/opendes:wks:AbstractFeatureCollection:1.0.0" + }, + "SpatialGeometryTypeID": { + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-SpatialGeometryType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Indicates the expected look of the SpatialParameterType, e.g. Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon. The value constrains the type of geometries in the GeoJSON Wgs84Coordinates and AsIngestedCoordinates.", + "x-osdu-relationship": [ + { + "EntityType": "SpatialGeometryType", + "GroupType": "reference-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractSpatialLocation.1.0.0.json" + }, + "opendes:wks:AbstractGeoFieldContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoFieldContext:1.0.0", + "description": "A single, typed field entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", + "title": "AbstractGeoFieldContext", + "type": "object", + "properties": { + "FieldID": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-Field:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Reference to Field.", + "x-osdu-relationship": [ + { + "EntityType": "Field", + "GroupType": "master-data" + } + ], + "type": "string" + }, + "GeoTypeID": { + "const": "Field", + "description": "The fixed type 'Field' for this AbstractGeoFieldContext." + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoFieldContext.1.0.0.json" + }, + "opendes:wks:AbstractFeatureCollection:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractFeatureCollection:1.0.0", + "description": "GeoJSON feature collection as originally published in https://geojson.org/schema/FeatureCollection.json. Attention: the coordinate order is fixed: Longitude first, followed by Latitude, optionally height above MSL (EPSG:5714) as third coordinate.", + "title": "GeoJSON FeatureCollection", + "type": "object", + "required": [ + "type", + "features" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "FeatureCollection" + ] + }, + "features": { + "type": "array", + "items": { + "title": "GeoJSON Feature", + "type": "object", + "required": [ + "type", + "properties", + "geometry" + ], + "properties": { + "geometry": { + "oneOf": [ + { + "type": "null" + }, + { + "title": "GeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "type": { + "type": "string", + "enum": [ + "Point" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "LineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "Polygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON GeometryCollection", + "type": "object", + "required": [ + "type", + "geometries" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "GeometryCollection" + ] + }, + "geometries": { + "type": "array", + "items": { + "oneOf": [ + { + "title": "GeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + }, + "type": { + "type": "string", + "enum": [ + "Point" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "LineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "Polygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "minItems": 4, + "type": "array", + "items": { + "minItems": 2, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + ] + } + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + ] + }, + "type": { + "type": "string", + "enum": [ + "Feature" + ] + }, + "properties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object" + } + ] + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + } + } + }, + "bbox": { + "minItems": 4, + "type": "array", + "items": { + "type": "number" + } + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractFeatureCollection.1.0.0.json" + }, + "opendes:wks:AbstractAccessControlList:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractAccessControlList:1.0.0", + "description": "The access control tags associated with this entity. This structure is included by the SystemProperties \"acl\", which is part of all OSDU records. Not extensible.", + "additionalProperties": false, + "title": "Access Control List", + "type": "object", + "properties": { + "viewers": { + "description": "The list of viewers to which this data record is accessible/visible/discoverable formatted as an email (core.common.model.storage.validation.ValidationDoc.EMAIL_REGEX).", + "title": "List of Viewers", + "type": "array", + "items": { + "pattern": "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$", + "type": "string" + } + }, + "owners": { + "description": "The list of owners of this data record formatted as an email (core.common.model.storage.validation.ValidationDoc.EMAIL_REGEX).", + "title": "List of Owners", + "type": "array", + "items": { + "pattern": "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$", + "type": "string" + } + } + }, + "required": [ + "owners", + "viewers" + ], + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractAccessControlList.1.0.0.json" + }, + "opendes:wks:AbstractGeoPlayContext:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractGeoPlayContext:1.0.0", + "description": "A single, typed Play entity reference, which is 'abstracted' to AbstractGeoContext and then aggregated by GeoContexts properties.", + "x-osdu-review-status": "Accepted", + "title": "AbstractGeoPlayContext", + "type": "object", + "properties": { + "PlayID": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-Play:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "Reference to the play.", + "x-osdu-relationship": [ + { + "EntityType": "Play", + "GroupType": "master-data" + } + ], + "type": "string" + }, + "GeoTypeID": { + "x-osdu-is-derived": { + "RelationshipPropertyName": "PlayID", + "TargetPropertyName": "PlayTypeID" + }, + "pattern": "^[\\w\\-\\.]+:reference-data\\-\\-PlayType:[\\w\\-\\.\\:\\%]+:[0-9]*$", + "description": "The PlayType reference of the Play (via PlayID) for application convenience.", + "x-osdu-relationship": [ + { + "EntityType": "PlayType", + "GroupType": "reference-data" + } + ], + "type": "string" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractGeoPlayContext.1.0.0.json" + }, + "opendes:wks:AbstractLegalParentList:1.0.0": { + "x-osdu-inheriting-from-kind": [], + "x-osdu-license": "Copyright 2021, The Open Group \\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.", + "$schema": "http://json-schema.org/draft-07/schema#", + "x-osdu-schema-source": "osdu:wks:AbstractLegalParentList:1.0.0", + "description": "A list of entity IDs in the data ecosystem, which act as legal parents to the current entity. This structure is included by the SystemProperties \"ancestry\", which is part of all OSDU records. Not extensible.", + "additionalProperties": false, + "title": "Parent List", + "type": "object", + "properties": { + "parents": { + "description": "An array of none, one or many entity references in the data ecosystem, which identify the source of data in the legal sense. In contract to other relationships, the source record version is required. Example: the 'parents' will be queried when e.g. the subscription of source data services is terminated; access to the derivatives is also terminated.", + "title": "Parents", + "type": "array", + "items": { + "x-osdu-relationship": [], + "pattern": "^[\\w\\-\\.]+:[\\w\\-\\.]+:[\\w\\-\\.\\:\\%]+:[0-9]+$", + "type": "string" + }, + "example": [] + } + }, + "$id": "https://schema.osdu.opengroup.org/json/abstract/AbstractLegalParentList.1.0.0.json" + } + }, + "properties": { + "ancestry": { + "description": "The links to data, which constitute the inputs.", + "title": "Ancestry", + "$ref": "#/definitions/opendes:wks:AbstractLegalParentList:1.0.0" + }, + "data": { + "allOf": [ + { + "$ref": "#/definitions/opendes:wks:AbstractCommonResources:1.0.0" + }, + { + "$ref": "#/definitions/opendes:wks:AbstractMaster:1.0.0" + }, + { + "type": "object", + "properties": {} + }, + { + "type": "object", + "properties": { + "ExtensionProperties": { + "type": "object" + } + } + } + ] + }, + "kind": { + "pattern": "^[\\w\\-\\.]+:[\\w\\-\\.]+:[\\w\\-\\.]+:[0-9]+.[0-9]+.[0-9]+$", + "description": "The schema identification for the OSDU resource object following the pattern {Namespace}:{Source}:{Type}:{VersionMajor}.{VersionMinor}.{VersionPatch}. The versioning scheme follows the semantic versioning, https://semver.org/.", + "title": "Entity Kind", + "type": "string", + "example": "osdu:wks:master-data--Test:1.0.0" + }, + "acl": { + "description": "The access control tags associated with this entity.", + "title": "Access Control List", + "$ref": "#/definitions/opendes:wks:AbstractAccessControlList:1.0.0" + }, + "version": { + "format": "int64", + "description": "The version number of this OSDU resource; set by the framework.", + "title": "Version Number", + "type": "integer", + "example": 1562066009929332 + }, + "tags": { + "description": "A generic dictionary of string keys mapping to string value. Only strings are permitted as keys and values.", + "additionalProperties": { + "type": "string" + }, + "title": "Tag Dictionary", + "type": "object", + "example": { + "NameOfKey": "String value" + } + }, + "modifyUser": { + "description": "The user reference, which created this version of this resource object. Set by the System.", + "title": "Resource Object Version Creation User Reference", + "type": "string", + "example": "some-user@some-company-cloud.com" + }, + "modifyTime": { + "format": "date-time", + "description": "Timestamp of the time at which this version of the OSDU resource object was created. Set by the System. The value is a combined date-time string in ISO-8601 given in UTC.", + "title": "Resource Object Version Creation DateTime", + "type": "string", + "example": "2020-12-16T11:52:24.477Z" + }, + "createTime": { + "format": "date-time", + "description": "Timestamp of the time at which initial version of this OSDU resource object was created. Set by the System. The value is a combined date-time string in ISO-8601 given in UTC.", + "title": "Resource Object Creation DateTime", + "type": "string", + "example": "2020-12-16T11:46:20.163Z" + }, + "meta": { + "description": "The Frame of Reference meta data section linking the named properties to self-contained definitions.", + "title": "Frame of Reference Meta Data", + "type": "array", + "items": { + "$ref": "#/definitions/opendes:wks:AbstractMetaItem:1.0.0" + } + }, + "legal": { + "description": "The entity's legal tags and compliance status. The actual contents associated with the legal tags is managed by the Compliance Service.", + "title": "Legal Tags", + "$ref": "#/definitions/opendes:wks:AbstractLegalTags:1.0.0" + }, + "createUser": { + "description": "The user reference, which created the first version of this resource object. Set by the System.", + "title": "Resource Object Creation User Reference", + "type": "string", + "example": "some-user@some-company-cloud.com" + }, + "id": { + "pattern": "^[\\w\\-\\.]+:master-data\\-\\-Test:[\\w\\-\\.\\:\\%]+$", + "description": "Previously called ResourceID or SRN which identifies this OSDU resource object without version.", + "title": "Entity ID", + "type": "string", + "example": "namespace:master-data--Test:ded98862-efe4-5517-a509-d99f4b941b20" + } + }, + "$id": "https://schema.osdu.opengroup.org/json/master-data/Test.1.0.0.json" + } +} \ No newline at end of file diff --git a/testing/indexer-test-gcp/pom.xml b/testing/indexer-test-gcp/pom.xml index 74f56c7ace3750aa7165602b6e19c394229ed3a3..cbefb50737b58238b5869cd65c159d45d515f67a 100644 --- a/testing/indexer-test-gcp/pom.xml +++ b/testing/indexer-test-gcp/pom.xml @@ -6,13 +6,13 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-gcp</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> @@ -37,7 +37,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-core</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.1-SNAPSHOT</version> </dependency> <!-- Cucumber --> diff --git a/testing/indexer-test-ibm/pom.xml b/testing/indexer-test-ibm/pom.xml index f85b8b8ad1a2d3216ac246e5fe580596d3cf6e35..af1fd0eec5e992c8b1ad8d8c35b75d0f6d73c413 100644 --- a/testing/indexer-test-ibm/pom.xml +++ b/testing/indexer-test-ibm/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> @@ -19,7 +19,7 @@ <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source> <cucumber.version>1.2.5</cucumber.version> - <os-core-lib-ibm.version>0.3.8-SNAPSHOT</os-core-lib-ibm.version> + <os-core-lib-ibm.version>0.7.0</os-core-lib-ibm.version> </properties> <dependencies> @@ -38,7 +38,7 @@ <dependency> <groupId>org.opengroup.osdu.indexer</groupId> <artifactId>indexer-test-core</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.1-SNAPSHOT</version> </dependency> <dependency> diff --git a/testing/pom.xml b/testing/pom.xml index 530619057e5638534ea2c8cb7bc0608cf1b8de1e..9d36987c79ff99bbea774dd4ebf269ff1d7fc156 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -18,7 +18,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.opengroup.osdu</groupId> <artifactId>indexer-test</artifactId> - <version>0.6.0-SNAPSHOT</version> + <version>0.8.0-SNAPSHOT</version> <description>Indexer Service Integration Test Root Project</description> <properties> <spring.version>5.1.19.RELEASE</spring.version>