# Collection with tripledoc

**URL:** <https://forum.solidproject.org/t/collection-with-tripledoc/3071>\
**Category:** General Discussion\
**Created:** [May 18, 2020, 12:34am UTC](https://forum.solidproject.org/t/collection-with-tripledoc/3071 "2020-05-18T00:34:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smag0](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/smag0/32/310_2.png) [@Smag0](https://forum.solidproject.org/u/Smag0)\
**Post date:** [May 18, 2020, 12:34am UTC](https://forum.solidproject.org/t/collection-with-tripledoc/3071/1 "2020-05-18T00:34:06Z")

</div>

Giving some try to implement Solid Meeting with @Vincent Tripledoc, it seems that the basic metting setting look like that  
[https://holacracy.solid.community/public/meeting/gouvernance/second%20meeting/index.ttl#this](https://holacracy.solid.community/public/meeting/gouvernance/second%20meeting/index.ttl#this) (generated with the databrowser)

```auto
@prefix : <#>.
@prefix mee: <http://www.w3.org/ns/pim/meeting#>.
@prefix ic: <http://www.w3.org/2002/12/cal/ical#>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix flow: <http://www.w3.org/2005/01/wf/flow#>.
@prefix c: </profile/card#>.
@prefix ui: <http://www.w3.org/ns/ui#>.
@prefix n0: <http://purl.org/dc/elements/1.1/>.

:id1589757677361
    ic:dtstart "2020-05-17T23:21:17Z"^^XML:dateTime;
    flow:participant c:me;
    ui:backgroundColor "#dbe0cb".
:this
    a mee:Meeting;
    n0:author c:me;
    n0:created "2020-05-17T23:21:01Z"^^XML:dateTime;
    ic:comment "comment cool";
    ic:dtend "2020-05-13"^^XML:date;
    ic:dtstart "2020-05-04"^^XML:date;
    ic:location "nowhere";
    ic:summary "second test meeting";
    flow:participation :id1589757677361;
    mee:toolList ( :this );
    ui:backgroundColor "#ddddcc"^^XML:color.

```

The two last line give me problem :  
Is there a way to add a “Collection” with brackets ? like ( $ 2.5 on that page [https://www.w3.org/TeamSubmission/turtle/#sec-tutorial](https://www.w3.org/TeamSubmission/turtle/#sec-tutorial))

```auto
 mee:toolList ( :this );

```

otherwise, the databrowser give me some error like [https://holacracy.solid.community/public/meeting/gouvernance/A%20new%20%20meeting/](https://holacracy.solid.community/public/meeting/gouvernance/A%20new%20%20meeting/) .  
Just adding the bracket manually give me a good meeting [https://holacracy.solid.community/public/meeting/gouvernance/helo/](https://holacracy.solid.community/public/meeting/gouvernance/helo/)  
but how can I do that with Tripledoc ?

and how can i specify (^^XML:color) ?

- are there any reason why the dates are not uniform (date / datetime)

```auto
ic:dtstart "2020-05-17T23:21:17Z"^^XML:dateTime;
ic:dtstart "2020-05-04"^^XML:date;

```

nor the backgroundcolor :

```auto
ui:backgroundColor "#dbe0cb".
ui:backgroundColor "#ddddcc"^^XML:color.

```

Thanxs for any advice on thoose questions 😉

---

<div class="post-metadata">

**Author:** ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)\
**Post date:** [May 18, 2020, 8:38am UTC](https://forum.solidproject.org/t/collection-with-tripledoc/3071/2 "2020-05-18T08:38:52Z")

</div>

Hi @Smag0, the brackets are RDF lists, which are somewhat cumbersome, and for which Tripledoc does not have convenience methods to make them easier to work with. (The same holds true for BlankNodes, which it uses behind the scenes.) I found this post, the introduction of which explains how lists are implemented: [http://www.snee.com/bobdc.blog/2014/04/rdf-lists-and-sparql.html](http://www.snee.com/bobdc.blog/2014/04/rdf-lists-and-sparql.html)

You can simulate them in Tripledoc by recreating its data structure, using regular `TripleSubject`s instead of BlankNodes. Off the top of my head, that would look something like this:

```javascript
import { fetchDocument } from 'tripledoc';
import { rdf } from 'rdf-namespaces';

fetchDocument('https://holacracy.solid.community/public/meeting/gouvernance/second%20meeting/index.ttl').then(meetingDoc => {
  const meeting = meetingDoc.getSubject('https://holacracy.solid.community/public/meeting/gouvernance/second%20meeting/index.ttl#this');

  const toolList = meetingDoc.addSubject();
  toolList.setRef(rdf.type, rdf.List);
  toolList.setRef(rdf.first, 'https://holacracy.solid.community/public/meeting/gouvernance/second%20meeting/index.ttl#this');
  toolList.setRef(rdf.rest, rdf.nil);

  meeting.setRef('http://www.w3.org/ns/pim/meeting#toolList', toolList.asRef();
});

```

As for `XML:color` - unfortunately Tripledoc does not have an `addColor` method yet ([contributions welcome](https://gitlab.com/vincenttunru/tripledoc/-/issues/49) 🙂 ). I thought it had an escape hatch to insert it yourself, but it does not. Let me know if this is an important feature for you in the short term, then I can prioritise its implementation.

I’m not sure why they’re using both `Date`s and `DateTime`s, but given the context, I’m assuming it’s the difference between a full-day appointment and something at a specific time/duration.

---

<div class="post-metadata">

**Author:** ![Smag0](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/smag0/32/310_2.png) [@Smag0](https://forum.solidproject.org/u/Smag0)\
**Post date:** [May 18, 2020, 10:27am UTC](https://forum.solidproject.org/t/collection-with-tripledoc/3071/3 "2020-05-18T10:27:27Z")

</div>

well it seems to give me a blankNode, [https://holacracy.solid.community/public/meeting/gouvernance/AAAAA/index.ttl](https://holacracy.solid.community/public/meeting/gouvernance/AAAAA/index.ttl) but mashlib don’t be agree [https://holacracy.solid.community/public/meeting/gouvernance/AAAAA/index.ttl#this](https://holacracy.solid.community/public/meeting/gouvernance/AAAAA/index.ttl#this)  
what do you mean by

> [@Vincent](#):
>
> using regular `TripleSubject` s instead of BlankNodes.

but got some rdf-namespaces issues with

```auto
rdf.nil
dc.created --> for purl
wf --> for flow 

```

thoose are “undefined” [https://holacracy.solid.community/public/meeting/gouvernance/aeaze/index.ttl](https://holacracy.solid.community/public/meeting/gouvernance/aeaze/index.ttl)

---

<div class="post-metadata">

**Author:** ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)\
**Post date:** [May 18, 2020, 11:15am UTC](https://forum.solidproject.org/t/collection-with-tripledoc/3071/4 "2020-05-18T11:15:26Z")

</div>

> [@Smag0](#):
>
> well it seems to give me a blankNode, [https://holacracy.solid.community/public/meeting/gouvernance/AAAAA/index.ttl](https://holacracy.solid.community/public/meeting/gouvernance/AAAAA/index.ttl)

I don’t see a BlankNode in there?

> but mashlib don’t be agree [https://holacracy.solid.community/public/meeting/gouvernance/AAAAA/index.ttl#this](https://holacracy.solid.community/public/meeting/gouvernance/AAAAA/index.ttl#this)

I’m not quite sure what it’s trying to do there, but I’m expecting it to be a bug in mashlib. It appears that it’s assuming some data to be there that there is not yet, but it’s hard to debug from that error message.

> but got some rdf-namespaces issues with
> 
> ```auto
> rdf.nil
> dc.created --> for purl
> wf --> for flow 
> 
> ```
> 
> thoose are “undefined” [https://holacracy.solid.community/public/meeting/gouvernance/aeaze/index.ttl](https://holacracy.solid.community/public/meeting/gouvernance/aeaze/index.ttl)

Hmm, rdf-namespaces is automatically generated from the vocabularies published at the given URLs. For each URL you mentioned, there appears to be a different reason it is not included:

# wf.participant

[https://www.w3.org/2005/01/wf/flow#partcipant](https://www.w3.org/2005/01/wf/flow#partcipant) just does not seem to be defined. That means you have two options:

1. Not use it, since it’s technically not part of that vocabulary.
2. Use the URL directly. The values from rdf-namespaces are just URLs, so you could just use `'https://www.w3.org/2005/01/wf/flow#partcipant'` where you’d use `wf.participant` instead.

# dc.created

Could it be that you’d want `dct.created` (so `dct` instead of `dc`) instead? Because [DCMI: DCMI Metadata Terms](http://purl.org/dc/elements/1.1/created) doesn’t point to anything either.

# rdf.nil

This is interesting. This property _is_ defined at [http://www.w3.org/1999/02/22-rdf-syntax-ns#nil](http://www.w3.org/1999/02/22-rdf-syntax-ns#nil), but it’s defined as being an `rdf:List` rather than an `rdfs:Class` or `rdf:Property`, for instance, which is why rdf-namespaces doesn’t include it - because it’s not technically a type, but a value (specifically, an -the- empty list). As a workaround, here too you can use the full URL (`'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'`) instead of `rdf.nil`.

Which reminds me: the earlier code snipped I posted probably also needs:

```auto
  toolList.setRef(rdf.type, rdf.List);

```

(I’ve updated it now.)

---

<div class="post-metadata">

**Author:** ![Smag0](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/smag0/32/310_2.png) [@Smag0](https://forum.solidproject.org/u/Smag0)\
**Post date:** [May 18, 2020, 12:55pm UTC](https://forum.solidproject.org/t/collection-with-tripledoc/3071/5 "2020-05-18T12:55:32Z")

</div>

Thxs for your help but rdf.List does not fix.  
I’ve created a mashlib issue [https://github.com/solid/mashlib/issues/92](https://github.com/solid/mashlib/issues/92)
