From ea6ef4c3c9dc2feb397842c32296139d7a1fd13b Mon Sep 17 00:00:00 2001 From: Loose Date: Fri, 11 Feb 2022 15:08:20 -0300 Subject: [PATCH 1/5] Updated sbt and plugins versions --- Dockerfile | 4 ++-- project/build.properties | 2 +- project/plugins.sbt | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 58a76c2..211ff2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:18.04 ARG USER_HOME_DIR="/root" ENV SCALA_VERSION 2.12.11 -ENV SBT_VERSION 1.3.9 +ENV SBT_VERSION 1.6.1 # Update the repository sources list and install dependencies RUN apt-get update @@ -43,7 +43,7 @@ RUN \ curl -L -o sbt-$SBT_VERSION.deb https://scala.jfrog.io/artifactory/debian/sbt-$SBT_VERSION.deb && \ dpkg -i sbt-$SBT_VERSION.deb && \ rm sbt-$SBT_VERSION.deb && \ - sbt sbtVersion + sbt -Dsbt.rootdir=true sbtVersion VOLUME "$USER_HOME_DIR/.sbt" diff --git a/project/build.properties b/project/build.properties index 1e70b0c..3161d21 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.0 +sbt.version=1.6.1 diff --git a/project/plugins.sbt b/project/plugins.sbt index 8fbed3f..f86b50d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,3 @@ -addSbtPlugin("com.eed3si9n" % "sbt-sriracha" % "0.1.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") -addSbtPlugin("com.github.mwz" % "sbt-sonar" % "2.1.0") \ No newline at end of file +addSbtPlugin("com.eed3si9n" % "sbt-sriracha" % "0.1.0") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") +addSbtPlugin("com.sonar-scala" % "sbt-sonar" % "2.3.0") From 93228d3bbedbdf0485b287a5d2d78b42a91cfab3 Mon Sep 17 00:00:00 2001 From: Loose Date: Tue, 15 Feb 2022 18:30:13 -0300 Subject: [PATCH 2/5] Added new field related with Semantic JSON Schema feature --- .gitignore | 3 +- .../exporters/VocabularyPropertiesTest.scala | 2 +- .../dialects/canonical_webapi_spec.yaml | 80 +++++++++++++++++-- .../main/resources/vocabularies/aml_meta.yaml | 50 +++++++++++- 4 files changed, 124 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index c21f0b5..e3f031f 100644 --- a/.gitignore +++ b/.gitignore @@ -94,4 +94,5 @@ project/plugins/project/ .cache .lib/ # Ignore Gradle build output directory -build \ No newline at end of file +build +.bsp \ No newline at end of file diff --git a/exporters/src/test/scala/amf/exporters/VocabularyPropertiesTest.scala b/exporters/src/test/scala/amf/exporters/VocabularyPropertiesTest.scala index 8ffbbd4..8ce4ba9 100644 --- a/exporters/src/test/scala/amf/exporters/VocabularyPropertiesTest.scala +++ b/exporters/src/test/scala/amf/exporters/VocabularyPropertiesTest.scala @@ -22,7 +22,7 @@ class VocabularyPropertiesTest extends AsyncFunSuite with VocabularyTest { } test("Vocabularies parsing aml_meta") { - testVocabulary(aml_meta, 19, 31) + testVocabulary(aml_meta, 25, 38) } test("Vocabularies parsing api_contract") { diff --git a/vocabulary/src/main/resources/dialects/canonical_webapi_spec.yaml b/vocabulary/src/main/resources/dialects/canonical_webapi_spec.yaml index d2a8ee8..62df31f 100644 --- a/vocabulary/src/main/resources/dialects/canonical_webapi_spec.yaml +++ b/vocabulary/src/main/resources/dialects/canonical_webapi_spec.yaml @@ -32,7 +32,7 @@ nodeMappings: Scalar: ScalarShape Any: AnyShape Recursive: RecursiveShape - + union: - UnionShape - TupleShape @@ -45,7 +45,7 @@ nodeMappings: - ScalarShape - AnyShape - RecursiveShape - + SecuritySettingsUnion: typeDiscriminatorName: settingsType typeDiscriminator: @@ -55,7 +55,7 @@ nodeMappings: Http: HttpSettings OpenID: OpenIDSettings HttpAPIKey: HttpAPIKeySettings - + union: - OAuth2Settings - OAuth1Settings @@ -63,7 +63,7 @@ nodeMappings: - HttpSettings - OpenIDSettings - HttpAPIKeySettings - + DataNodeUnion: typeDiscriminatorName: elementType @@ -812,7 +812,7 @@ nodeMappings: - ParametrizedResourceType - ParametrizedTrait allowMultiple: true - + path: propertyTerm: apiContract.path range: string @@ -1116,7 +1116,7 @@ nodeMappings: propertyTerm: doc.extends range: Message allowMultiple: true - + name: propertyTerm: core.name range: string @@ -1443,7 +1443,7 @@ nodeMappings: - Operation - ParametrizedTrait allowMultiple: true - + method: propertyTerm: apiContract.method range: string @@ -2292,6 +2292,72 @@ nodeMappings: allowMultiple: true + baseIRIModel: + classTerm: meta.ContextBaseIri + mapping: + iri: + propertyTerm: meta.iri + range: link + nulled: + propertyTerm: meta.nulled + range: boolean + + + contextMappingModel: + classTerm: meta.ContextMapping + mapping: + contextAlias: + propertyTerm: meta.contextAlias + range: string + iri: + propertyTerm: meta.iri + range: link + coercion: + propertyTerm: meta.coercion + range: string + nulled: + propertyTerm: meta.nulled + range: boolean + + + curiePrefixModel: + classTerm: meta.ContextCuriePrefix + mapping: + contextAlias: + propertyTerm: meta.contextAlias + range: string + iri: + propertyTerm: meta.iri + range: link + + + defaultVocabularyModel: + classTerm: meta.ContextDefaultVocabulary + mapping: + iri: + propertyTerm: meta.iri + range: link + + + semanticContextModel: + classTerm: meta.SemanticContext + mapping: + base: + propertyTerm: meta.base + range: baseIRIModel + vocab: + propertyTerm: meta.vocab + range: defaultVocabularyModel + curies: + propertyTerm: meta.curies + range: curiePrefixModel + allowMultiple: true + mappings: + propertyTerm: meta.mappings + range: contextMappingModel + allowMultiple: true + + documents: diff --git a/vocabulary/src/main/resources/vocabularies/aml_meta.yaml b/vocabulary/src/main/resources/vocabularies/aml_meta.yaml index e9fc07e..4085245 100644 --- a/vocabulary/src/main/resources/vocabularies/aml_meta.yaml +++ b/vocabulary/src/main/resources/vocabularies/aml_meta.yaml @@ -3,10 +3,25 @@ vocabulary: meta base: http://a.ml/vocabularies/meta# usage: Vocabulary containing meta-definitions uses: - doc: aml_doc.yaml shacl: external/shacl.yaml + doc: aml_doc.yaml owl: external/owl.yaml classTerms: + ConditionalNodeMapping: + displayName: ConditionalNodeMapping + extends: shacl.Shape + ContextBaseIri: + displayName: baseIRIModel + description: Encodes information about the base document IRI for the model element @ids + ContextCuriePrefix: + displayName: curiePrefixModel + description: Stores information about a CURIE prefix defined in the context + ContextDefaultVocabulary: + displayName: defaultVocabularyModel + description: Encodes information about the base vocabulary to map by default properties and types in the model + ContextMapping: + displayName: contextMappingModel + description: Stores information about mapping rules for a property in the model Dialect: displayName: Dialect description: Definition of an AML dialect, mapping AST nodes from dialect documents into an output semantic graph @@ -77,6 +92,9 @@ classTerms: PublicNodeMapping: displayName: PublicNodeMapping description: Mapping for a graph node mapping to a particular function in a dialect + SemanticContext: + displayName: semanticContextModel + description: Set of semantic contextual information that can be attached to a schema UnionNodeMapping: displayName: UnionNodeMapping extends: shacl.Shape @@ -96,8 +114,20 @@ propertyTerms: range: boolean base: displayName: base - description: Base URI for the external model + description: Base IRI used to generate all the @ids in the model + range: ContextBaseIri + coercion: + displayName: coercion + description: Type to coerce the mapped model range: string + contextAlias: + displayName: contextAlias + description: lexical value of the alias in the context + range: string + curies: + displayName: curies + description: Set of CURIE prefixes defined in a context + range: ContextCuriePrefix declarationsPath: displayName: declarationsPath description: Information about the AST location of the declarations to be parsed as declared domain elements @@ -143,6 +173,10 @@ propertyTerms: displayName: fragments description: Mapping of fragment base unit for a particular dialect range: DocumentMapping + iri: + displayName: iri + description: Base IRI for all the elements in the model + range: uri keyProperty: displayName: keyProperty description: Information about whether the dialect is defined by the header or a key property @@ -171,10 +205,18 @@ propertyTerms: displayName: mappedNode description: Node in the dialect definition associated to this mapping range: uri + mappings: + displayName: mappings + description: Set of property mappings and coercions defined in a context + range: ContextMapping mergePolicy: displayName: mergePolicy description: Indication of how to merge this graph node when applying a patch document range: string + nulled: + displayName: nulled + description: Marks the baseIRI as null, preventing generation of absolute IRIs in the model + range: boolean properties: displayName: properties description: Properties that have the ClassTerm in the domain @@ -210,3 +252,7 @@ propertyTerms: displayName: unique description: Marks the values for the property mapping as a primary key for this type of node range: boolean + vocab: + displayName: vocab + description: Default IRI prefix used to map by default all properties and terms in the model + range: ContextDefaultVocabulary From bfa5e350657a5f22bef37a5567e96698e08c9ca0 Mon Sep 17 00:00:00 2001 From: Nicolas Schejtman Date: Thu, 3 Mar 2022 22:13:05 -0300 Subject: [PATCH 3/5] Adopt amf-api-contract 5.0.5 & amf-rdf 6.0.5-RC.0 Publish vocabulary 21.0.0-RC.0 & transform 2.5.0-RC.0 --- transform/dependencies.properties | 4 ++-- versions.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/transform/dependencies.properties b/transform/dependencies.properties index 08048b4..c086995 100644 --- a/transform/dependencies.properties +++ b/transform/dependencies.properties @@ -1,4 +1,4 @@ # Leave here for the publication process to detect if amf-transform has to be published! # Because we publish a version of amf-transform for each version of amf-client publish. -amf.apicontract=5.1.0-SNAPSHOT -amf.rdf=6.1.0-SNAPSHOT +amf.apicontract=5.0.5-RC.0 +amf.rdf=6.0.5-RC.0 diff --git a/versions.yaml b/versions.yaml index aab01e7..7fec5a6 100644 --- a/versions.yaml +++ b/versions.yaml @@ -1,2 +1,2 @@ -amf.vocabulary: 20.0.0-SNAPSHOT -amf.transform: 2.4.0-SNAPSHOT +amf.vocabulary: 21.0.0-RC.0 +amf.transform: 2.5.0-RC.0 From 8a9e4f6cafa0cf445f0fe293d9df21f2612e4bc0 Mon Sep 17 00:00:00 2001 From: Nicolas Schejtman Date: Fri, 4 Mar 2022 01:43:49 -0300 Subject: [PATCH 4/5] Add release/* to publish step --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index e900d12..9a21df8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,6 +67,7 @@ pipeline { anyOf { branch 'master' branch 'develop' + branch 'release/*' } // expression { hasChangesIn("vocabulary", "vocabulary") || isDevelop() } } @@ -93,6 +94,7 @@ pipeline { anyOf { branch 'master' branch 'develop' + branch 'release/*' } // expression { hasChangesIn("transform", "transform") || isDevelop() } } From 78efc849730f757839ec4d50f2549923b6151106 Mon Sep 17 00:00:00 2001 From: Loose Date: Tue, 8 Mar 2022 12:53:14 -0300 Subject: [PATCH 5/5] Publish amf.vocabulary 21.0.0 and amf.transform 2.5.0 --- Jenkinsfile | 2 -- transform/dependencies.properties | 4 ++-- versions.yaml | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9a21df8..e900d12 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,7 +67,6 @@ pipeline { anyOf { branch 'master' branch 'develop' - branch 'release/*' } // expression { hasChangesIn("vocabulary", "vocabulary") || isDevelop() } } @@ -94,7 +93,6 @@ pipeline { anyOf { branch 'master' branch 'develop' - branch 'release/*' } // expression { hasChangesIn("transform", "transform") || isDevelop() } } diff --git a/transform/dependencies.properties b/transform/dependencies.properties index c086995..b2908d7 100644 --- a/transform/dependencies.properties +++ b/transform/dependencies.properties @@ -1,4 +1,4 @@ # Leave here for the publication process to detect if amf-transform has to be published! # Because we publish a version of amf-transform for each version of amf-client publish. -amf.apicontract=5.0.5-RC.0 -amf.rdf=6.0.5-RC.0 +amf.apicontract=5.0.5 +amf.rdf=6.0.5 diff --git a/versions.yaml b/versions.yaml index 7fec5a6..b78f607 100644 --- a/versions.yaml +++ b/versions.yaml @@ -1,2 +1,2 @@ -amf.vocabulary: 21.0.0-RC.0 -amf.transform: 2.5.0-RC.0 +amf.vocabulary: 21.0.0 +amf.transform: 2.5.0