In ActivityPub, these are all equivalent:
-
In ActivityPub, these are all equivalent:
"type":"Banana"
"type":["Banana"]
"type":{"@id":"Banana"}
"type":[{"@id":"Banana"}]
"type":{"id":"Banana"}
"type":[{"id":"Banana"}]
"@type":"Banana"
"@type":["Banana"]
"@type":{"@id":"Banana"}
"@type":[{"@id":"Banana"}]
"@type":{"id":"Banana"}
"@type":[{"id":"Banana"}]
-
In ActivityPub, these are all equivalent:
"type":"Banana"
"type":["Banana"]
"type":{"@id":"Banana"}
"type":[{"@id":"Banana"}]
"type":{"id":"Banana"}
"type":[{"id":"Banana"}]
"@type":"Banana"
"@type":["Banana"]
"@type":{"@id":"Banana"}
"@type":[{"@id":"Banana"}]
"@type":{"id":"Banana"}
"@type":[{"id":"Banana"}]
@reiver That's... kinda shite.
-
In ActivityPub, these are all equivalent:
"type":"Banana"
"type":["Banana"]
"type":{"@id":"Banana"}
"type":[{"@id":"Banana"}]
"type":{"id":"Banana"}
"type":[{"id":"Banana"}]
"@type":"Banana"
"@type":["Banana"]
"@type":{"@id":"Banana"}
"@type":[{"@id":"Banana"}]
"@type":{"id":"Banana"}
"@type":[{"id":"Banana"}]
@reiver That's assuming "Banana" is a term defined in the JSON-LD context. Even then, the expanded "Banana" term (e.g., "https://server.example/fruits#Banana" is also valid and equivalent.
-
@reiver That's assuming "Banana" is a term defined in the JSON-LD context. Even then, the expanded "Banana" term (e.g., "https://server.example/fruits#Banana" is also valid and equivalent.
Yes, you are correct, all those are equivalent, too.
Plus any CURIE form (ex: abc:Banana).
I couldn't fit all those in the 500 character limit.
-
@reiver That's assuming "Banana" is a term defined in the JSON-LD context. Even then, the expanded "Banana" term (e.g., "https://server.example/fruits#Banana" is also valid and equivalent.
@steve @reiver See https://github.com/w3c/json-ld-syntax/issues/446 for a related issue. JSON-LD @\type IRIs get expanded against a @\vocab prefix, or if one is not present then they get expanded against the @\base, and if *that* can't be determined then they are actually not expanded.
However, you don't have to worry about cases like "@type":{"@id":"Banana"} because those are not valid. Per https://www.w3.org/TR/json-ld11/#specifying-the-type you only have to worry about strings and arrays of strings.
Also AS2 compacts @\type to type.
-
@steve @reiver See https://github.com/w3c/json-ld-syntax/issues/446 for a related issue. JSON-LD @\type IRIs get expanded against a @\vocab prefix, or if one is not present then they get expanded against the @\base, and if *that* can't be determined then they are actually not expanded.
However, you don't have to worry about cases like "@type":{"@id":"Banana"} because those are not valid. Per https://www.w3.org/TR/json-ld11/#specifying-the-type you only have to worry about strings and arrays of strings.
Also AS2 compacts @\type to type.
-
@reiver That's... kinda shite.
@OliviaVespera @reiver It's also not correct; only the first 2 cases are valid/compliant. (If ActivityPub didn't define "type" to mean @\type, then it would be only the 7th and 8th cases in that list.)
-
@trwnh @reiver The classic example of this issue is a property like `attributedTo` or its subproperty `actor` (just two of many examples). The range is Object|Link. That means the property value could be URI, an Object, a Link or an array (set) of any combination of URIs, Objects or Links where the URI could be compacted, expanded or a CURIE.
-
@trwnh @reiver The classic example of this issue is a property like `attributedTo` or its subproperty `actor` (just two of many examples). The range is Object|Link. That means the property value could be URI, an Object, a Link or an array (set) of any combination of URIs, Objects or Links where the URI could be compacted, expanded or a CURIE.
@steve @reiver Yup. Makes me wish we used an actual normal/canonical form that was more constrained. Even in the AS2 context I've oft thought @\type: @\id could be a mistake since {id: foo} is usually preferable; also, any non-functional property really ought to be @\container: @\set. those would be backwards-incompatible changes, though. and even if someone defined a simpler easier-to-understand profile, what's the point if people don't use it?
-
@OliviaVespera @reiver It's also not correct; only the first 2 cases are valid/compliant. (If ActivityPub didn't define "type" to mean @\type, then it would be only the 7th and 8th cases in that list.)
Why do you feel that the 7th & 8th cases are not "valid"?
"@type":"Banana"
"@type":["Banana"]
...
At the following, "type" is set as an alias for "@type":
https://www.w3.org/ns/activitystreams.jsonld
But, AFAICT, in JSON-LD creating an alias (such as "type") does not make the original form (such as "@type") invalid.
Are you claiming the 7th & 8th form are invalid JSON-LD?
Or, are you claiming the 7th & 8th form are valid JSON-LD, but invalid ActivityPub?
Or, something else?
-
R relay@relay.mycrowd.ca shared this topic