Comments (5)
from activitystreams.
I believe the only type that "matters" is @id
since this directly controls whether something is an @id
or a @value
, hence why I explored closedBy
as a possible solution, and then dropping the xsd:datetime
because this is more of a "hint" for any type checkers.
from activitystreams.
Dmitri will reach out to JSON-LD folks to find out if there's a way to encode these multiple types.
If not, we should probably keep "closed" as a datetime as currently defined in the context document, and consider recommending other existing properties like "result" as seen in the Vocabulary document in [Representing Questions)(https://www.w3.org/TR/activitystreams-vocabulary/#questions). This may rise to the level of an erratum, although it's not clear that this is not the author's or working group's intent.
We should also do a survey of existing usage to see if any software uses the other types besides datetime.
from activitystreams.
Defining a context term as both an object reference (@id
) and a @value
(if that's allowed) causes issues in modeling the associated vocabulary/ontology using OWL. In OWL, a property must be either an ObjectProperty
or a DataProperty
, but not both. This is already a problem for url
("@id" in the context, but Link | xsd:anyURI
in the vocabulary). It would be nice to not expand that anti-pattern. Note that xsd:anyURI
is a literal so it would be a @value
in the context and a DataProperty
in OWL.
EDIT: After doing more reading, I'm not completely sure about xsd:anyURI
modeling in JSON-LD contexts. I see some information saying it could be either, depending on the "context" (sorry). I do know it caused issues when I was working on an OWL ontology for AS2. #440 is also somewhat related.
from activitystreams.
If the expanded term definition contains the
@type
keyword, its value MUST be an IRI, a compact IRI, a term, null, or one of the keywords@id
,@json
,@none
, or@vocab
.
So this rules out the array type as an option.
Starting with this extended context:
{
"@context": ["https://www.w3.org/ns/activitystreams", {
"closedBy": {
"@id": "https://www.w3.org/ns/activitystreams#closed",
"@type": "@id"
}
}],
"closed": "2023-09-01",
"closedBy": "https://example.com/pr/1"
}
We see that this results in the unambiguous expanded form:
[
{
"https://www.w3.org/ns/activitystreams#closed": [
{
"@type": "http://www.w3.org/2001/XMLSchema#dateTime",
"@value": "2023-09-01"
},
{
"@id": "https://example.com/pr/1"
}
]
}
]
And this compacts against AS2's context into this:
{
"@context": "https://www.w3.org/ns/activitystreams",
"closed": "2023-09-01",
"as:closed": {
"id": "https://example.com/pr/1"
}
}
So I think the correct solution to this is, from an LD perspective:
- Add a term
closedBy
which has@type: @id
to the normative context - Either:
- amend/errata such that
xsd:boolean
is no longer in the range ofclosed
- remove
@type: xsd:datetime
fromclosed
in order to support boolean values.- (This might break old documents which encode
xsd:datetime
and were stored as expanded form, but this is a theoretical corner case since I assume most implementations store documents roughly in compacted form or some database format that can be used to construct the compacted form.)
- (This might break old documents which encode
- amend/errata such that
The addition of closedBy
should not be problematic unless implementations already used node objects for closed
, but this is honestly more of a bug that should be fixed because it would currently not be consistent with the compacted form, and there isn't actually a way to be consistent with the compacted form without defining such a term for @type: @id
use cases. The compaction would see the id-node as invalid and the property would be changed from closed
to as:closed
, as seen in this playground example: https://json-ld.org/playground/#startTab=tab-compacted&json-ld=%5B%7B%22https%3A%2F%2Fwww.w3.org%2Fns%2Factivitystreams%23closed%22%3A%5B%7B%22%40id%22%3A%22https%3A%2F%2Fexample.com%2Fpr%2F1%22%7D%5D%7D%5D&context=%7B%22%40context%22%3A%5B%22https%3A%2F%2Fwww.w3.org%2Fns%2Factivitystreams%22%5D%7D
I don't think this is a good candidate for a FEP because there is a clear error in the normative AS2 context compared to the spec, and I think it should be fixed. Terms should be @id
or @value
but not both, as @steve-bate points out. This is a quirk of JSON-LD in much the same way that orderedItems
is a term that has the same @id
as items
, i.e. https://www.w3.org/ns/activitystreams#items
, but the former term is defined with @container: @list
and the latter term is not. The Activity Vocabulary spec page doesn't actually define orderedItems
as a property, and it is used only in JSON-LD examples.
from activitystreams.
Related Issues (20)
- Document usage of Link in places where it is not semantically clear HOT 7
- Rename branch `master` to `main` HOT 2
- the orderedItems property mentioned in the Activity Streams 2.0 recommendation is not defined in the Activity Vocabulary HOT 8
- Update copyright statement and license to 2023 W3C software and document license HOT 1
- activitystreams-history: Generate v1.11 context document HOT 1
- Link from rolling version of the AS2 context to the latest numbered version
- Update AS2 Terms document with new copyright statement and license link HOT 1
- Default units for Place Object HOT 1
- Improvements to the Place type
- Appropriately defined properties for Content Warnings and Content Labels HOT 11
- Removing the domain constraints on the AS mediaType property HOT 21
- Use example names instead of numbers so they are persistent
- Update version document Primer page to include full versioning process
- Guidance on automated account actors AKA "bots" HOT 1
- Difference between @type/@id in JSON-LD and type/id in AcitivtyStream HOT 3
- `relationship` in JSON-LD context document should use `@type: @vocab` HOT 6
- Expand the domain of `closed` to be applicable to more than just `Question`? HOT 5
- `href` should be `@type: xsd:anyURI` in the context document HOT 1
- `url` is defined as `@type: @id` in the context document which precludes use of xsd:anyURI values HOT 5
- The vocabulary definition does not agree with the spec HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from activitystreams.