Skip to content

Commit 5ce84d5

Browse files
committed
Merge branch 'master' into internal/latest-au-icons
2 parents 5f4ddaa + e599a4b commit 5ce84d5

File tree

8 files changed

+112
-205
lines changed

8 files changed

+112
-205
lines changed

.changeset/rdfa-rework.md

+2-41
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,8 @@
22
"@lblod/ember-rdfa-editor": minor
33
---
44

5-
Overhaul in the way we handle RDFa in the editor:
6-
This release contains a completely rework in how we handle RDFa documents and RDF data in the editor.
7-
These features are fully opt-in and should be considered experimental.
8-
9-
#### Changes
10-
11-
Instead of using and dealing with plain RDFa attributes, this release introduces an new `rdfaAware` API:
12-
Two types of RDFa-aware node types are introduced: `resource` nodes and `literal` nodes.
13-
14-
##### Resource nodes
15-
Resource nodes as the name suggests, define a `resource` in a document. This resource is always represented by a URI.
16-
A document may contain multiple resource nodes, which may define the same or different resources.
17-
In equivalent RDFa, a resource node will typically be serialized to an html element with the RDFa `about` attribute.
18-
Resource nodes may contain the following prosemirror attributes:
19-
- `subject`: the URI of the resource
20-
- `properties`: a list of properties defined on the subject/resource. These properties correspond with RDF triples for which the resource URI is the subject.
21-
- `backlinks`: contains the 'inverses' of properties. Corresponds with RDF triples for which the resource URI is the object. The `subject` of these backlinks will typically also be defined in the document using a resource node.
22-
- `__rdfaId`: a unique id representing the resource node. You can use this id to search specific nodes in a document.
23-
24-
##### Literal nodes
25-
Literal nodes define a `literal` in a document. This node will typically be the target of a property defined by a resource node. The content of the `literal` is defined by the content inside a literal node.
26-
Literal nodes may contain the following prosemirror attributes:
27-
- `backlinks`: contains the 'inverses' of properties. Corresponds with RDF triples for which the literal is the object. The `subject` of these backlinks will typically also be defined in the document using a resource node. Literal nodes will typically only have 1 backlink.
28-
- `__rdfaId`: a unique id representing the literal node. You can use this id to search specific nodes in a document.
29-
Note: literal nodes do not have `subject` or `properties` attributes. Literals can not define the subject of an RDF triple.
30-
31-
##### Changes to existing node-specs
32-
Most of the nodes contained in this package (`block_rdfa`, `inline_rdfa`, `heading` etc.) are now provided in two versions: an `rdfaAware` version an a non-`rdfaAware` version:
33-
`blockRdfaWithConfig` replaces `block_rdfa`: `blockRdfaWithConfig` is a configurable node-spec which allows developers to specify whether the node-spec should work in an `rdfaAware` way or not.
34-
Similar to `blockRdfaWithConfig`, other node-specs have also been replaced by a configurable version (check-out the `deprecations` section).
35-
The configurable node-specs are by default non-`rdfaAware`. The static nodespecs remain included in this package for now, but have been marked as deprecated.
36-
37-
##### Other changes included in this release
38-
Apart from the changes included to the node-specs and the ways we handle RDFa, this release also contains several new (experimental) tools and API to work with the new `rdfaAware` system.
39-
Some of these tools are marked as private (such as experimental GUI tools and API) and are thus not part of the public API.
40-
Among these, the following tools/API are included:
41-
- A new parser/serializer system that allows to correctly parse and serialize `rdfaAware` nodes and documents
42-
- New prosemirror commands to work with the `rdfaAware` system
43-
- GUI tools (some of these are private API) to operate and interact with `rdfaAware` nodes and documents
44-
45-
5+
This release contains experimental support for the new `rdfaAware` system and API.
6+
For more information, check out [A new approach to handle RDFa in documents](https://github.com/lblod/ember-rdfa-editor/blob/9c32a9dea0da13df4092c39d9a092ba0803a3f42/README.md#experimental-a-new-approach-to-handle-rdfa-in-documents)
467

478
#### Deprecations
489
- Passing the `keyMapOptions` argument to the `RdfaEditor` is deprecated. The behaviour of `selectBlockRdfaNode` is included by default. This feature will be removed in the next major release.

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,45 @@ It may contain the following entries:
205205
Instances of the `ProseController` class can be used to control different aspects of the editor.
206206
🚧 interface docs under construction, refer to the source files for now 🚧
207207

208+
## Experimental: a new approach to handle RDFa in documents
209+
This package also contains an opt-in, experimental way in how RDFa is handled.
210+
211+
### Changes
212+
Instead of using and dealing with plain RDFa attributes, this approach introduces an new `rdfaAware` API:
213+
Two types of RDFa-aware node types are introduced: `resource` nodes and `literal` nodes.
214+
215+
#### Resource nodes
216+
Resource nodes as the name suggests, define a `resource` in a document. This resource is always represented by a URI.
217+
A document may contain multiple resource nodes, which may define the same or different resources.
218+
In equivalent RDFa, a resource node will typically be serialized to an html element with the RDFa `about` attribute.
219+
Resource nodes may contain the following prosemirror attributes:
220+
- `subject`: the URI of the resource
221+
- `properties`: a list of properties defined on the subject/resource. These properties correspond with RDF triples for which the resource URI is the subject.
222+
- `backlinks`: contains the 'inverses' of properties. Corresponds with RDF triples for which the resource URI is the object. The `subject` of these backlinks will typically also be defined in the document using a resource node.
223+
- `__rdfaId`: a unique id representing the resource node. You can use this id to search specific nodes in a document.
224+
225+
#### Literal nodes
226+
Literal nodes define a `literal` in a document. This node will typically be the target of a property defined by a resource node. The content of the `literal` is defined by the content inside a literal node.
227+
Literal nodes may contain the following prosemirror attributes:
228+
- `backlinks`: contains the 'inverses' of properties. Corresponds with RDF triples for which the literal is the object. The `subject` of these backlinks will typically also be defined in the document using a resource node. Literal nodes will typically only have 1 backlink.
229+
- `__rdfaId`: a unique id representing the literal node. You can use this id to search specific nodes in a document.
230+
Note: literal nodes do not have `subject` or `properties` attributes. Literals can not define the subject of an RDF triple.
231+
232+
#### Changes to existing node-specs
233+
Most of the nodes contained in this package (`block_rdfa`, `inline_rdfa`, `heading` etc.) are now provided in two versions: an `rdfaAware` version an a non-`rdfaAware` version:
234+
`blockRdfaWithConfig` replaces `block_rdfa`: `blockRdfaWithConfig` is a configurable node-spec which allows developers to specify whether the node-spec should work in an `rdfaAware` way or not.
235+
Similar to `blockRdfaWithConfig`, other node-specs have also been replaced by a configurable version.
236+
The configurable node-specs are by default non-`rdfaAware`.
237+
238+
#### Other changes included as part of the `rdfaAware` system
239+
Apart from the changes included to the node-specs and the ways we handle RDFa, the `rdfaAware` system also comes with several new (experimental) tools and APIs.
240+
Some of these tools are marked as private (such as experimental GUI tools and API) and are thus not part of the public API.
241+
Among these, the following tools/API are included:
242+
- A new parser/serializer system that allows to correctly parse and serialize `rdfaAware` nodes and documents
243+
- New prosemirror commands to work with the `rdfaAware` system
244+
- GUI tools (some of these are private API) to operate and interact with `rdfaAware` nodes and documents
245+
246+
208247
## More examples
209248
More examples on how to integrate this editor in your application can be found in the dummy app of this addon or in the plugins repository of the LBLOD project (https://github.com/lblod/ember-rdfa-editor-lblod-plugins).
210249

0 commit comments

Comments
 (0)