Skip to content

Use valid expanded json ld#1089

Merged
zonotope merged 27 commits intomainfrom
refactor/valid-expanded-json-ld
Aug 14, 2025
Merged

Use valid expanded json ld#1089
zonotope merged 27 commits intomainfrom
refactor/valid-expanded-json-ld

Conversation

@zonotope
Copy link
Contributor

This patch updates our json-ld dependency to the version from fluree/json-ld#44 which changes the behavior of the json-ld library to return valid expanded json-ld data from the fluree.json-ld/expand function, and makes all the necessary changes to use the new format for expanded json-ld data.

zonotope added 21 commits July 7, 2025 16:42
- Updated fluree/json-ld dependency to git sha f82df2f9163924f0a5ff98e79e4a0bc338e3ddcd
- New version produces standard expanded JSON-LD instead of proprietary format
- Existing utility functions (get-first-value, get-value, etc.) already handle valid JSON-LD structure
- Keyword usage as compact IRIs preserved with proper context support
@zonotope zonotope requested a review from a team August 13, 2025 13:25
@zonotope zonotope self-assigned this Aug 13, 2025
@zonotope
Copy link
Contributor Author

@fluree/core this is ready for review

[node]
(if (subject-node? node)
(update node :id iri->kw)
(update node "@id" iri->kw)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the const/iri-id and friends in this file instead of the string literal versions?

(and
(contains? mapx :set)
(= #{:set :idx} (set (keys mapx))))
(contains? mapx "@set")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make a const for this?

[mapx]
(cond
(contains? mapx :value)
(contains? mapx "@value")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And use a const for this as well.


(= :type pred)
(let [values* (map (fn [typ] {:id typ})
(= "@type" pred)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const here

:else jsonld))
(if (contains? jsonld "@graph")
(get jsonld "@graph")
jsonld))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And consts in this file as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use a const here because of a circular dependency in the const namespace. At least, I'd rather not hold up this pr to resolve the circular dependency. I'll leave a TODO for that.

Copy link
Contributor

@dpetran dpetran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥥

@zonotope zonotope merged commit e6df029 into main Aug 14, 2025
9 checks passed
@zonotope zonotope deleted the refactor/valid-expanded-json-ld branch August 14, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants