o-development / ldo

Monorepo for Linked Data Objects (ldo)
MIT License
29 stars 6 forks source link

Multiple context `@type`s will cause undefined datatypes #53

Open jaxoncreed opened 3 months ago

jaxoncreed commented 3 months ago

For example if the context looks like this

summary: {
    "@id": "https://www.w3.org/ns/activitystreams#summary",
    "@type": [
      "http://www.w3.org/2001/XMLSchema#string",
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",
    ],
    "@container": "@set",
  },

And the code looks like this

article.summary = "";

The triple will look like this

<http://localhost:3000/blog/post3/index.ttl#article> <https://www.w3.org/ns/activitystreams#name> ""^^_:undefined .
chuixuewan commented 2 months ago

I met this problem too, this always happen when serval nested shape got the same attribute name, like this one: .shex:

<Profile> CLOSED {
    fhir:value xsd:anyURI
}

<Quantity> CLOSED {
    fhir:value xsd:decimal;
    fhir:unit xsd:string?;
    fhir:system xsd:anyURI?;
    fhir:code xsd:string?
}

context:

value: {
    "@id": "http://hl7.org/fhir/value",
    "@type": [
      "http://www.w3.org/2001/XMLSchema#anyURI",
      "http://www.w3.org/2001/XMLSchema#decimal",
    ],
  },