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

W-11460908: remove full JSON path from property terms in JSON-LD objects #1800

Merged
merged 1 commit into from
May 10, 2023

Conversation

nschejtman
Copy link
Contributor

No description provided.

pope1838
pope1838 previously approved these changes May 9, 2023
@@ -39,11 +39,19 @@ case class JsonLDObjectElementParser(
override def findClassTerm(ctx: SemanticContext): Seq[String] = {
val terms = super.findClassTerm(ctx).map(ctx.expand)
if (terms.isEmpty) {
val fragment = if (path.toString.isEmpty) key else path.toString
val fragment = lastNameFromPath() match {
Copy link
Contributor

Choose a reason for hiding this comment

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

this whole if-clause could be refactored into a method so we isolate @id computation logic

.getOrElse(semanticContext.computeBase(name))

// should be unreachable
case _ => throw new IllegalStateException(s"Property ${path.toString} does not have name")
Copy link
Contributor

Choose a reason for hiding this comment

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

[Out of Scope] - This is shady, we should have a safe-compiler way of doing this check (I don't know how at the moment)

@nschejtman nschejtman merged commit 37b76d5 into develop May 10, 2023
@nschejtman nschejtman deleted the W-11460908 branch May 10, 2023 13:48
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.

3 participants