gobengo / activitystreams2-spec-scraped

ActivityStreams 2.0 vocabulary in machine-readable form, scraped using TypeScript + cheerio
Apache License 2.0
9 stars 1 forks source link

Spec currently says `width` and `height` are of Domain `Link` - how can this be right? #15

Open sebilasse opened 2 years ago

sebilasse commented 2 years ago

In current scraped spec data line 4598

{
  "id": "as:width",
  "type": [
    "rdf:Property",
    "owl:FunctionalProperty"
  ],
   "example": {
      "id": "https://www.w3.org/TR/activitystreams-vocabulary/#ex159-jsonld",
      "type": "https://schema.org/CreativeWork",
      "mainEntity": {
        "type": "Link",
        "height": 100,
        "href": "http://example.org/image.png",
        "width": 100
      },
      "name": "Example 138"
    },
    "notes": "On a Link, specifies a hint as to the rendering width in device-independent pixels of the linked resource.",
    "domain": {
        "type": "owl:Class",
        "unionOf": {
        "type": "Link",
        "href": "https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link",
        "name": "Link"
      }
    }

But then see e.g. Example 79 and 80 in the spec. where it is treated of Domain Object

I think, width and height is needed for both, Objects like Image as well as for Link.

In @redaktor, width and height are measured for each image if missing and is also needed for building srcset / responsive design.

gobengo commented 2 years ago

Good catch. IMO example 79 and 80 are 'invalid' according to the current version of the spec. By the look of other examples, ex 79 could isntead be:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "summary": "A simple note",
  "type": "Note",
  "content": "This is all there is.",
  "icon": {
    "type": "Image",
    "name": "Note icon",
    "url": {
      "type": "Link",
      "href": "http://example.org/note.png",
      "width": 16,
      "height": 16
    },
  }
}