CarbonLDP / carbonldp

CarbonLDP's general wiki and issue tracking project
8 stars 1 forks source link

Create an LDP-RS which is not an LDPC #10

Closed noorbakerally closed 5 years ago

noorbakerally commented 7 years ago

i'm am trying to create an LDP-RS which is not an LDPC using the Carbon LDP Workbench but i'm not able to do so, when i am creating a child document, its type always include container,

so my question is: Using Carbon LDP, is it possible to create an LDP-RS which is not an LDPC ?

MiguelAraCo commented 7 years ago

The short answer: No

The long answer:

Even though we implemented the LDP standard, our main model is called a "Document". These documents can act as ldp:RDFSources or ldp:Containers depending on a Prefer header you set specifying the interaction model you want them to display. Meaning that on a per request basis, the document can act differently. With that flexibility in mind we didn't see any benefit of limiting documents to only act as ldp:RDFSources and not as ldp:Containers.

There's also a property you can set up on each document to specify the c:defaultInteractionModel the Document should have. That way if you don't specify the Prefer header on a request, the configured ldp:defaultInteractionModel will be used.

Having said that, it doesn't mean that you can't restrict how they act. Depending on the security schema you define, you can make sure that no one can use a specific Document as an ldp:Container (although it will still have the type).

May I ask you: why are you interested in creating ldp:RDFSources that are not ldp:Containers?

noorbakerally commented 7 years ago

a simple example would be, I have a set of parkings in a city, and I want to have a LDPC Parkings which contains every parking in the city, http://example.com/parkings would be a LDPC for the parkings and http://example.com/parkings/p1 would be only a RDF Source in the LDPC, in this case, http://example.com/parkings/p1 is an atomic resource and we may not want it to handle CRUD operations which is possible on a collection

MiguelAraCo commented 7 years ago

To accomplish that you can set the c:defaultInteractionModel of http://example.com/parkings/p1 to ldp:RDFSource and modify the ACL of http://example.com/parkings so all of its children don't allow cs:CreateChild, cs:AddMember, cs:RemoveMember or cs:Upload.

This has the added benefit of really restricting any child of http://example.com/parkings from acting as an ldp:Container (meaning not a per-resource solution).

noorbakerally commented 7 years ago

yes i do understand this, thanks for the answer, i'll try this and will let you know

MiguelAraCo commented 7 years ago

The Workbench is somewhat limited right now when it comes to editing ACLs. Please let me know if you need any help 👍