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

defining a prop as xsd:boolean loses its prefixed URL #558

Open
VladimirAlexiev opened this issue Oct 12, 2024 · 3 comments
Open

defining a prop as xsd:boolean loses its prefixed URL #558

VladimirAlexiev opened this issue Oct 12, 2024 · 3 comments

Comments

@VladimirAlexiev
Copy link

VladimirAlexiev commented Oct 12, 2024

Given this context

{"@context":
 {"owl": "http://www.w3.org/2002/07/owl#",
  "xsd": "http://www.w3.org/2001/XMLSchema#",
  "owl:deprecated": {"@type": "xsd:boolean"}
 }
}

This instance data

{
  "@id": "ex:Ontology",
  "http://www.w3.org/2002/07/owl#deprecated": true
}

is compacted to

{
  "@context": {
    "owl": "http://www.w3.org/2002/07/owl#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "owl:deprecated": {
      "@type": "xsd:boolean"
    }
  },
  "@id": "ex:Ontology",
  "http://www.w3.org/2002/07/owl#deprecated": true
}

As you see, the prefix owl: is not used for the property.
If I remove the prop type from the context

  "owl:deprecated": {"@type": "xsd:boolean"}

Then the prop is shortened.

Same happens in playground and https://github.com/digitalbazaar/jsonld-cli/releases/tag/v2.0.0

@msporny @gkellogg is this expected?

@gkellogg
Copy link
Collaborator

Yes, it is operating as designed. Term selection looks for exact patterns, and would have used owl:deprecated if it were "true"^^xsd:boolean, but it needs to match that value pattern, and not a native value. JSON-LD only takes native types into consideration for from and to RDF transformation.

@VladimirAlexiev
Copy link
Author

which means that ALL json native values are useless or harmful, and only strings should be used .
Right?

@gkellogg
Copy link
Collaborator

which means that ALL json native values are useless or harmful, and only strings should be used . Right?

Pretty much :) native values generally loose fidelity, and the algorithms intentionally ignore them. JSON-LD is really about interpreting string values.

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

No branches or pull requests

2 participants