w3c / wot-thing-description

Web of Things (WoT) Thing Description
http://w3c.github.io/wot-thing-description/
Other
131 stars 63 forks source link

Use of hctl:hasTarget in the `links` section #1459

Open ethieblin opened 2 years ago

ethieblin commented 2 years ago

As discussed in #1310, and based on many example of form fields, hctl:hasTarget should be a DatatypeProperty.

However, this property is also used in the links section, where it may be used to reference a URI (e.g., that of an other TD) or a URL pattern (see this comment).

By looking in the examples in the documentation (links section example and reified links example), we are unsure how the links were meant for.

If one wants to add new triples with the TD as the triple subject, would using the property directly be enough ? The context to add in the TD would explicit how to interpret the value (URI or Literal).

{
    "@context": [
        ...,
        { "broader": {
             "@id": "http://www.w3.org/2004/02/skos/core#broader",
             "@type": "@id"
         }
    ],
    "id": "urn:my:thing",
    "broader": "urn:my:parent:thing"
}

Another proposition would be to create a specific property, similar to hasTarget but dedicated to owl:Individuals, called "object" in the following example:

{
    "@context": [
        ...,
        { "broader":  "http://www.w3.org/2004/02/skos/core#broader" }
    ],
    "id": "urn:my:thing"
    "links": [
        {
            "rel": "broader",
            "object": "urn:my:parent:thing"
        }
    ]
}

In the reified links example, it is not clear if that example is supposed to reify the following triple, and how this information may be used

<https://en.wikipedia.org/wiki/Web_of_Things> <http://schema.org/about> <http://www.wikidata.org/entity/Q2814098> .
wiresio commented 2 years ago

Shouldn't it be like this?

{
    "@context": [
        ...,
        { "skos":  "http://www.w3.org/2004/02/skos/core#" }
    ],
    "id": "urn:my:thing"
    "links": [
        {
            "rel": "skos:broader",
            "object": "urn:my:parent:thing"
        }
    ]
}
ethieblin commented 2 years ago

Both would work with URI definition and with prefix definition

wiresio commented 2 years ago

Thanks for clarifying! The example that I have given looks more familiar to me.

ethieblin commented 2 years ago

This issue is more an open question about the links section example and reified links example: