Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch to Titanium JSON-LD library #1073

Merged
merged 19 commits into from
Jan 15, 2024

Conversation

bobeal
Copy link
Member

@bobeal bobeal commented Dec 31, 2023

No description provided.

@bobeal bobeal self-assigned this Dec 31, 2023
@github-actions github-actions bot added the feature New feature or request label Dec 31, 2023
Copy link
Contributor

github-actions bot commented Dec 31, 2023

Test Results

 55 files  + 1   55 suites  +1   1m 21s ⏱️ ±0s
901 tests +14  901 ✅ +14  0 💤 ±0  0 ❌ ±0 
940 runs  +14  940 ✅ +14  0 💤 ±0  0 ❌ ±0 

Results for commit 1087976. ± Comparison against base commit fd8f7f1.

This pull request removes 129 and adds 66 tests. Note that renamed tests count towards both.

               "2020-03-25T08:33:17.965206Z"
               "urn:ngsi-ld:Beekeeper:1234",
               20,
               25,
            "instanceId":"urn:ngsi-ld:Instance:45678",
            "instanceId":"urn:ngsi-ld:In…
            "observedAt":"2020-03-25T08:33:17.965206Z",
            "sub": "sub"
            "type":"Property",
…
com.egm.stellio.search.util.AttributeInstanceUtilsTests ‑ it should guess the value type of a boolean property()
com.egm.stellio.search.util.AttributeInstanceUtilsTests ‑ it should guess the value type of a datetime property()
com.egm.stellio.search.util.AttributeInstanceUtilsTests ‑ it should guess the value type of a double property()
com.egm.stellio.search.util.AttributeInstanceUtilsTests ‑ it should guess the value type of a string property()
com.egm.stellio.search.util.AttributeInstanceUtilsTests ‑ it should guess the value type of a time property()
com.egm.stellio.search.util.AttributeInstanceUtilsTests ‑ it should guess the value type of an array property()
com.egm.stellio.search.util.AttributeInstanceUtilsTests ‑ it should guess the value type of an int property()
com.egm.stellio.search.util.AttributeInstanceUtilsTests ‑ it should guess the value type of an object property()
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [10] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=bbe165c1-99f1-4dc4-947b-fd60f9a2ca92, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Property, attributeValueType=STRING, datasetId=null, createdAt=2024-01-15T07:44:36.358224617Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[SimplifiedAttributeInstanceResult(temporalEntityAttribute=156e6b1b-ecfb-49c6-b27e-8ac5ca4b87d8, value=Beehive_incoming_123, time=2020-03-25T08:29:17.965206Z), SimplifiedAttributeInstanceRe…, withTemporalValues=true, withAudit=false, expectation={
  "@id": "urn:ngsi-ld:BeeHive:TESTC",
  "@type": [
    "https://ontology.eglobalmark.com/apic#BeeHive"
  ],
  "https://ontology.eglobalmark.com/apic#incoming": [
    {
      "@type": [
        "https://uri.etsi.org/ngsi-ld/Property"
      ],
      "https://uri.etsi.org/ngsi-ld/hasValues": [
        {
          "@list": [
            {
              "@list": [
                {
                  "@value": "Beehive_incoming_123"
                },
                {
                  "@value": "2020-03-25T0…
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [11] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=947bee4b-5d6a-4c11-9c87-da960a946a1e, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Relationship, attributeValueType=STRING, datasetId=urn:ngsi-ld:Dataset:45678, createdAt=2024-01-15T07:44:36.358224617Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[SimplifiedAttributeInstanceResult(temporalEntityAttribute=3f0627db-3237-4f5e-9ef1-1b45f4be395d, value=urn:ngsi-ld:Entity:1234, time=2020-03-25T08:29:17.965206Z), S…, withTemporalValues=true, withAudit=false, expectation={
  "@id": "urn:ngsi-ld:BeeHive:TESTC",
  "@type": [
    "https://ontology.eglobalmark.com/apic#BeeHive"
  ],
  "https://ontology.eglobalmark.com/apic#incoming": [
    {
      "@type": [
        "https://uri.etsi.org/ngsi-ld/Relationship"
      ],
      "https://uri.etsi.org/ngsi-ld/datasetId": [
        {
          "@id": "urn:ngsi-ld:Dataset:45678"
        }
      ],
      "https://uri.etsi.org/ngsi-ld/hasObjects": [
        {
          "@list": [
            {
              "@list": [
                {
…
…

♻️ This comment has been updated with latest results.

bobeal added 19 commits January 15, 2024 08:38
- use the same (poorly typed) contract as with current lib
- integrate library into JsonLdUtils
- improve typing of some expanded form structures
- redo all the JSON-LD processing of temporal entities (do it once before rendering, as it is done for entities)
- use local JSON-LD context server extension for JUnit5 based on https://www.mock-server.com/
- add a Value suffix to make clear they are just doing this
- clean the documentation
- add a specific extension functions to add non-reified properties (temporal and non-temporal ones)
- rename JsonLdEntity to ExpandedEntity
- extract compacted entity processings in a new CompactedEntity file
@bobeal bobeal force-pushed the feature/switch-titanium-jsonld-lib branch from c6eb261 to 1087976 Compare January 15, 2024 07:39
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
78.9% Coverage on New Code
0.3% Duplication on New Code

See analysis details on SonarCloud

@bobeal bobeal merged commit 145be88 into develop Jan 15, 2024
10 checks passed
@bobeal bobeal deleted the feature/switch-titanium-jsonld-lib branch January 15, 2024 07:56
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Fix compact rendering of properties of all types
1 participant