Your main question
Assuming your data is already RDF (e.g. JSON-LD) in your Pod, for now, to support interoperability, you need to perform some sort of (RDF) reasoning in your application. There are many ways to do this, either through logical reasoning engines (e.g. eye, or OWL reasoners) or hard-code the reasoning rules in programming languages.
What that eventually needs to achieve is to add more data (triples) in your RDF (JSON-LD) resource before consumed by a component requiring specific shape of the resource.
I haven’t read the details of timbot1789/solid-calendar
, but, for example, if solid-calendar requires a sc:name
property of xsd:string
type to denote the title of the calendar entry, you need to write a reasoning rule which finds ?s ex:caption ?Title
and adds ?s sc:name ?Title
(e.g. when finding ex:caption "给太微加性能检测"
, add sc:name "给太微加性能检测"
for the same subject). (Also note the difference in prefixes here I used to illustrate the differences.)
For example, in N3, this rule can be written as:
{ ?n ex:caption ?Title } => { ?n sc:name ?Title }.
(Or, you may want to do it the other way around.)
Whether you want to persist this new resource (with enriched data) into your Pod is a choice for your application. I would recommend doing so.
In terms of future, a better solution is needed. But for now, this is the way you need.
Also, remember your application will need to respect that the resource in user’s Pod can contain additional triples than it understands. This aligns with the ethos of semantic web and related technologies (open-world assumption), but may not be the way how other applications/libraries are implemented.
Two questions to ask yourself first:
- What do you mean by “knowledge base”? Is it any conceptual thing that stores knowledge (in structured or unstructured format), or an RDF knowledge base/graph? If it’s the former, Solid won’t provide any support (other than BaaS). If it’s the latter, see the next question.
- Do you need the knowledge base stored in the exact same structure, and how performant you need? Unfortunately Solid cannot support everything yet. Either you will have to store the knowledge base using Solid’s storage schema (i.e. LDP), or you will store your knowledge base as a single file thus suffering from performance issues when loading it in your application. (This is why Comunica with cache may help, or a SPARQL backend for Solid service may be helpful.)
Further topics
N3 patch
N3-patch is easy to use directly, but I agree the documentation is not very easy to follow for people not used to read specs.
In fact, N3-patch is just the following:
- An HTTP
PATCH
request, with Content-Type: text/n3
, and
- Its content is a valid N3 Patch document (containing a query as the
where
clause, and then modifications through insert
and delete
), such as this example in the spec.
So you can use the standard JS fetch()
function for this, and thus no need for a library.
The reason it’s called N3 Patch is because it uses / complies with N3 language, a superset of Turtle.
Notification
I haven’t used that feature yet, but there is solid-client-notifications.
Maybe @CxRes knows more as I remember he has a lot of experience with this feature.
Cooperative editing
Cooperative editing is a separate topic, as it’s not only related to notifications, but also to the synchronization mechanism. CRDT is a promising (somewhat newer) technology for decentralized collaboration, which I like; Operational Transformation is another (older?) technology requiring a central server.
@gaz009 mentioned m-ld, which is one library for CRDT I looked into recently; another possibility is Soukai, which has an example at here. (I also opened this discussion at Soukai and engaged in this discussion at m-ld which may or may not be useful to you.)
As a summary, m-ld does not use Solid Pod for synchronization and you’ll find issues when storing data to your Pod (because data has state). In principle a storage backend can support Solid Pod, but a) it doesn’t exist yet; and b) there might be performance issue to always serialize CRDT states. Soukai uses Solid Pod to store CRDT history, but you need to design a bit of your synchronization mechanism/implementation within your application.