Re: [protege-user] JSON-LD ontology won't load in Protege

Michael DeBellis <[email protected]> Mon, 29 Dec 2025 08:09:50 -0800
Newsgroups gmane.comp.misc.ontology.protege.owl
Message-ID <CALGFikeyaN_0OcfVtfik3mvq-4Gu0kOqTczDdzxnr9xkf=-Yzg@mail.gmail.com>
--===============0929219097391663076==
Content-Type: multipart/alternative; boundary="0000000000009347ca064719793f"

--0000000000009347ca064719793f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I haven't use JSON LD much so I pasted the file into ChatGPT. Here's the
feedback I got:

As **pasted**, I would not call it =E2=80=9Cvalid JSON-LD=E2=80=9D, for two=
 separate
reasons:

## 1) It isn=E2=80=99t valid JSON as pasted

* Everything after the final `}` (the =E2=80=9C=E2=98=9B Click the line num=
bers=E2=80=A6 powered by
=E2=80=A6=E2=80=9D text) makes the whole paste **not JSON**.
* There=E2=80=99s also a suspicious standalone =E2=80=9Cblank=E2=80=9D line=
 right before the
`fgb:Data` node that looks like a **non-breaking space** (U+00A0). JSON
only allows whitespace characters `space`, `tab`, `CR`, `LF`. A literal
NBSP character can make a JSON parser fail even though it *looks* like
normal whitespace.

If you delete the non-JSON footer text and ensure that =E2=80=9Cblank=E2=80=
=9D line is a
normal newline (or remove it), it will likely parse as JSON.

## 2) Even if it parses, it likely won=E2=80=99t generate the RDF you inten=
d
(JSON-LD modeling issue)

In JSON-LD, a string like `"fgb:File"` is treated as an **IRI** only when
the *property* is defined in the context as an IRI-valued property (i.e.,
`@type: "@id"`), or you use an object form like `{ "@id": "fgb:File" }`.

Right now you have lots of places like:

* `"rdfs:subClassOf": "dcat:Dataset"`
* `"rdfs:domain": "fgb:File"`
* `"rdfs:range": "fgb:Header"`
* `"owl:onProperty": "fgb:hasHeader"`
* `"owl:allValuesFrom": "xsd:boolean"`
* `"rdfs:isDefinedBy": "fgb:"`

Unless you add coercions in `@context`, many of those will become **string
literals** (e.g., `"dcat:Dataset"` as a literal) instead of IRIs =E2=80=94 =
which
will break OWL semantics in tools.

### Minimal fix pattern

Add IRI coercions in the context for the properties that should point to
resources/classes/properties:

```json
"rdfs:subClassOf": { "@type": "@id" },
"rdfs:subPropertyOf": { "@type": "@id" },
"rdfs:domain": { "@type": "@id" },
"rdfs:range": { "@type": "@id" },
"rdfs:isDefinedBy": { "@type": "@id" },

"owl:onProperty": { "@type": "@id" },
"owl:allValuesFrom": { "@type": "@id" },
"owl:someValuesFrom": { "@type": "@id" },
"owl:hasValue": { "@type": "@id" }
```

Alternatively, change values to object form everywhere (more verbose), e.g.
`"rdfs:subClassOf": { "@id": "dcat:Dataset" }`.

---

### Bottom line

* **Not valid JSON(-LD) as pasted** (extra footer text; likely NBSP line).
* **Once cleaned**, it can be valid JSON-LD syntax, but **you should add
`@type: "@id"` coercions** (or use `{ "@id": ... }`) or you=E2=80=99ll get =
lots of
literals where you intended IRIs.



On Sat, Dec 27, 2025 at 6:39=E2=80=AFPM Reese Ricci Armstrong via protege-u=
ser <
[email protected]> wrote:

> I=E2=80=99m racking my brain trying to get this ontology to load into Pro=
tege, and
> I=E2=80=99m hoping someone might be able to provide some insight.
>
> https://commie.io/#9wfhhBll
>
> In solidarity,
>
> --reese
> _______________________________________________
> protege-user mailing list
> [email protected]
> https://mailman.stanford.edu/mailman/listinfo/protege-user
>

--0000000000009347ca064719793f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I haven&#39;t use JSON LD much so I pasted the file into C=
hatGPT. Here&#39;s the feedback I got:<br><br>As **pasted**, I would not ca=
ll it =E2=80=9Cvalid JSON-LD=E2=80=9D, for two separate reasons:<br><br>## =
1) It isn=E2=80=99t valid JSON as pasted<br><br>* Everything after the fina=
l `}` (the =E2=80=9C=E2=98=9B Click the line numbers=E2=80=A6 powered by =
=E2=80=A6=E2=80=9D text) makes the whole paste **not JSON**.<br>* There=E2=
=80=99s also a suspicious standalone =E2=80=9Cblank=E2=80=9D line right bef=
ore the `fgb:Data` node that looks like a **non-breaking space** (U+00A0). =
JSON only allows whitespace characters `space`, `tab`, `CR`, `LF`. A litera=
l NBSP character can make a JSON parser fail even though it *looks* like no=
rmal whitespace.<br><br>If you delete the non-JSON footer text and ensure t=
hat =E2=80=9Cblank=E2=80=9D line is a normal newline (or remove it), it wil=
l likely parse as JSON.<br><br>## 2) Even if it parses, it likely won=E2=80=
=99t generate the RDF you intend (JSON-LD modeling issue)<br><br>In JSON-LD=
, a string like `&quot;fgb:File&quot;` is treated as an **IRI** only when t=
he *property* is defined in the context as an IRI-valued property (i.e., `@=
type: &quot;@id&quot;`), or you use an object form like `{ &quot;@id&quot;:=
 &quot;fgb:File&quot; }`.<br><br>Right now you have lots of places like:<br=
><br>* `&quot;rdfs:subClassOf&quot;: &quot;dcat:Dataset&quot;`<br>* `&quot;=
rdfs:domain&quot;: &quot;fgb:File&quot;`<br>* `&quot;rdfs:range&quot;: &quo=
t;fgb:Header&quot;`<br>* `&quot;owl:onProperty&quot;: &quot;fgb:hasHeader&q=
uot;`<br>* `&quot;owl:allValuesFrom&quot;: &quot;xsd:boolean&quot;`<br>* `&=
quot;rdfs:isDefinedBy&quot;: &quot;fgb:&quot;`<br><br>Unless you add coerci=
ons in `@context`, many of those will become **string literals** (e.g., `&q=
uot;dcat:Dataset&quot;` as a literal) instead of IRIs =E2=80=94 which will =
break OWL semantics in tools.<br><br>### Minimal fix pattern<br><br>Add IRI=
 coercions in the context for the properties that should point to resources=
/classes/properties:<br><br>```json<br>&quot;rdfs:subClassOf&quot;: { &quot=
;@type&quot;: &quot;@id&quot; },<br>&quot;rdfs:subPropertyOf&quot;: { &quot=
;@type&quot;: &quot;@id&quot; },<br>&quot;rdfs:domain&quot;: { &quot;@type&=
quot;: &quot;@id&quot; },<br>&quot;rdfs:range&quot;: { &quot;@type&quot;: &=
quot;@id&quot; },<br>&quot;rdfs:isDefinedBy&quot;: { &quot;@type&quot;: &qu=
ot;@id&quot; },<br><br>&quot;owl:onProperty&quot;: { &quot;@type&quot;: &qu=
ot;@id&quot; },<br>&quot;owl:allValuesFrom&quot;: { &quot;@type&quot;: &quo=
t;@id&quot; },<br>&quot;owl:someValuesFrom&quot;: { &quot;@type&quot;: &quo=
t;@id&quot; },<br>&quot;owl:hasValue&quot;: { &quot;@type&quot;: &quot;@id&=
quot; }<br>```<br><br>Alternatively, change values to object form everywher=
e (more verbose), e.g. `&quot;rdfs:subClassOf&quot;: { &quot;@id&quot;: &qu=
ot;dcat:Dataset&quot; }`.<br><br>---<br><br>### Bottom line<br><br>* **Not =
valid JSON(-LD) as pasted** (extra footer text; likely NBSP line).<br>* **O=
nce cleaned**, it can be valid JSON-LD syntax, but **you should add `@type:=
 &quot;@id&quot;` coercions** (or use `{ &quot;@id&quot;: ... }`) or you=E2=
=80=99ll get lots of literals where you intended IRIs.<br><br><br></div><br=
><div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D=
"gmail_attr">On Sat, Dec 27, 2025 at 6:39=E2=80=AFPM Reese Ricci Armstrong =
via protege-user &lt;<a href=3D"mailto:[email protected]">pro=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204=
,204,204);padding-left:1ex">I=E2=80=99m racking my brain trying to get this=
 ontology to load into Protege, and I=E2=80=99m hoping someone might be abl=
e to provide some insight.<br>
<br>
<a href=3D"https://commie.io/#9wfhhBll" rel=3D"noreferrer" target=3D"_blank=
">https://commie.io/#9wfhhBll</a><br>
<br>
In solidarity,<br>
<br>
--reese<br>
_______________________________________________<br>
protege-user mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">proteg=
[email protected]</a><br>
<a href=3D"https://mailman.stanford.edu/mailman/listinfo/protege-user" rel=
=3D"noreferrer" target=3D"_blank">https://mailman.stanford.edu/mailman/list=
info/protege-user</a><br>
</blockquote></div>

--0000000000009347ca064719793f--

--===============0929219097391663076==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
protege-user mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/protege-user

--===============0929219097391663076==--