Skip to content

Commit

Permalink
updated README a lot!
Browse files Browse the repository at this point in the history
  • Loading branch information
langens-jonathan committed Sep 4, 2016
1 parent d151f98 commit 62cb6f2
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 56 deletions.
89 changes: 81 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,90 @@
to run call:
# All this is [experi]-MENTAL

All this code is experimental and is not intended to be used for anything! Further I introduce some new things for practical purposes, because they are handy and/or because I am too lazy to try to come up with better solutions at this point. Everything is still up for debate but we want something usable quick. So this thing, whatever it is, will not follow the idea we talked about fully. It will however adhere to all the general principles and it will, hopefully, be a source of inspiration, a testiment that the idea we have might just be valid.

# What is here already?

## No API's whatsoever

Sorry no api's whatsoever! What does this mean? Well instead of having a GUI we will have to inject triples in graphs to make this thing sing.

## SPARQL Graph free

Whatever you graph you specify will be replaced with the graph that is currently your graph. If you don't specify a graph then your 'current' graph is added to your queries. For now I have switched everything that would be in the application graph to be in the graphs graph. At this point I have the following meta-graphs in mind:
* the meta-graph which describes that metagraphs and what would fall in their bucket by default
* a user meta-graph
* a graphs meta-graph (describes 'graphs' and what users have access)
* a nodes meta-graph (describes the tree we drew on the whiteboard for every user)
* a update meta-graph (describes for every user: the sensible default, if this is none then all triples that would go there are thrown away <- seems like a handy feature should we have a anonymous user, and all it's buckets.
* a instances meta-graph (describes just ready made instances, this is handy for knowing what to update and to facilitate gets)

## all GET's should work

All get's should work, some updates may look like they might work. But updates are not supported whatsoever.

## it supports complete trees

The way we drew it on the board is how it works. The cardinality of the nodes is important, the computation of the eventual graph is more or less done in the way we drew it out on the whiteboard. I think we want to allow for subscopes but just write it to remind myself of this. Anyway the complex seven node tree is no problem, I have tested it!.

# How to use?

## Prepping (heating the spoon, taking a fresh needle, pumping out the air, ... you know the drill)

Although I forsee the use of several meta-graphs and what not for know I use only 2. The instance graph at <http://mu.semte.ch/instances> which will hold all calculated instances. And the graphs graph <http://mu.semte.ch/graphs> which functions as all meta-graphs. This means that to make this work you will need to insert some data in the graphs graph. The instances are taken care of by the system. To insert the correct data execute the following query on your SPARQL endpoint:
```
docker run -e SPARQLENDPOINT=http://x.x.x.x:8890/sparql flowofcontrol/scoping-scopes
prefix mu:<http://mu.semte.ch/vocabularies/core/>
prefix foaf:<http://xmlns.com/foaf/0.1/>
prefix graphs:<http://mu.semte.ch/vocabularies/graphs/>
with <http://mu.semte.ch/graphs>
insert
{
<http://mu.semte.ch/users/jonathan> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/OnlineAccount>;
<http://mu.semte.ch/vocabularies/core/uuid> "JONATHAN";
<http://mu.semte.ch/vocabularies/account/status> <http://mu.semte.ch/vocabularies/account/status/active>;
graphs:hasAccessToGraph <http://mu.semte.ch/graphs/graph1>, <http://mu.semte.ch/graphs/personalGraph1>;
graphs:hasNodes <http://mu.semte.ch/nodes/1>, <http://mu.semte.ch/nodes/2>.
<http://mu.semte.ch/nodes/1> graphs:forGraph <http://mu.semte.ch/graphs/graph1>.
<http://mu.semte.ch/nodes/2> graphs:forGraph <http://mu.semte.ch/graphs/personalGraph1>.
<http://mu.semte.ch/sessions/0c2e05a5-0b52-419c-a99a-394c30979706> <http://mu.semte.ch/vocabularies/session/account> <http://mu.semte.ch/users/jonathan>;
<http://mu.semte.ch/vocabularies/core/uuid> "SESSIONJONATHAN".
<http://mu.semte.ch/graphs/graph1> <mu:uuid> "GRAPH1";
<foaf:name> "http://mu.semte.ch/application";
<mu:graphType> "hive";
a <mu:Graph>.
<http://mu.semte.ch/graphs/personalGraph1> <mu:uuid> "PERSONALGRAPH1";
<foaf:name> "http://langens.jonathan/Personal-Graph-1";
<mu:graphType> "personal";
a <mu:Graph>.
}
```

## What are these graphs?

example call
After this is done there are 2 graphs created, the application graph and the personal graph. You can also verify that since no default update point nor any baskets are set that no update will be persistent (at least not beyond the instance graphs, and they don't matter anyway).

method: GET
header: "user-uuid":"JONATHANUUID"
url: http://[IP OF THIS DOCKER]:8080/sparql?query=select%20*%20where%20%7B%3Fs%20%3Fp%20%3Fo%20.%7D
As you guessed these graphs are a little bit more complex than the concept of a graph that is used in a triple store. I refer to our whiteboard to explain. A graph has a set of inserts (this is just the graph as you would expect), a set of deletes and a query (only half-assed implemented so this doesn't work). The application is a hive graph (level 4 on the whiteboard) so it's deletes are mute.
To test the functionality you can, again using your SPARQL endpoint insert data in the following graphs:
* <http://mu.semte.ch/application>
* <http://mu.semte.ch/graphs/personalGraph1>
* <http://mu.semte.ch/graphs/personalGraph1/delete>

Normally the instance graph should be what you expect it to be using the 'graph math'.

example call 2
# now you want to query, no?

Well first you have to start the endpoint, do this by running the following command:
```
docker run -e SPARQLENDPOINT=http://x.x.x.x:8890/sparql flowofcontrol/scoping-scopes
```

Then you can send queries to this thing all day long. I will include more stuff in the example data but for now this is what it is. To query the instance graph for me you can send the following request:
```
method: GET
header: "user-uuid":"ERIKAUUID"
header: "MU-SESSION-ID":"http://mu.semte.ch/sessions/0c2e05a5-0b52-419c-a99a-394c30979706"
url: http://[IP OF THIS DOCKER]:8080/sparql?query=select%20*%20where%20%7B%3Fs%20%3Fp%20%3Fo%20.%7D
```

Of course if you want to send a POST and have the query in the body (see the SPARQL spec for more info) that is also perfectably usable!
63 changes: 15 additions & 48 deletions insert-this-into-your-store-or-none-of-this-shit-will-work.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,25 @@ prefix graphs:<http://mu.semte.ch/vocabularies/graphs/>

insert
{
<http://mu.semte.ch/graphs/personalGraph1> <mu:uuid> "PERSONALGRAPH1";
<foaf:name> "Personal Graph 1";
<mu:graphType> "personal";
a <mu:Graph>.
<http://mu.semte.ch/graphs/personalGraph2> <mu:uuid> "PERSONALGRAPH2";
<foaf:name> "Personal Graph 2";
<mu:graphType> "personal";
a <mu:Graph>.
<http://mu.semte.ch/graphs/personalGraph3> <mu:uuid> "PERSONALGRAPH3";
<foaf:name> "Personal Graph 3";
<mu:graphType> "personal";
a <mu:Graph>.

<http://mu.semte.ch/users/jonathan> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/OnlineAccount>;
<http://mu.semte.ch/vocabularies/core/uuid> "JONATHAN";
<http://mu.semte.ch/vocabularies/account/status> <http://mu.semte.ch/vocabularies/account/status/active>;
graphs:hasAccessToGraph <http://mu.semte.ch/graphs/graph1>, <http://mu.semte.ch/graphs/personalGraph1>
graphs:hasNodes <http://mu.semte.ch/nodes/1>, <http://mu.semte.ch/nodes/2>.
<http://mu.semte.ch/nodes/1> graphs:forGraph <http://mu.semte.ch/graphs/graph1>.
<http://mu.semte.ch/nodes/2> graphs:forGraph <http://mu.semte.ch/graphs/personalGraph1>.

<http://mu.semte.ch/sessions/0c2e05a5-0b52-419c-a99a-394c30979706> <http://mu.semte.ch/vocabularies/session/account> <http://mu.semte.ch/users/jonathan>;
<http://mu.semte.ch/vocabularies/core/uuid> "SESSIONJONATHAN".

<http://mu.semte.ch/graphs/graph1> <mu:uuid> "GRAPH1";
<foaf:name> "Graph 1";
<foaf:name> "http://mu.semte.ch/application";
<mu:graphType> "hive";
a <mu:Graph>.
<http://mu.semte.ch/graphs/graph2> <mu:uuid> "GRAPH2";
<foaf:name> "Graph 2";
<mu:graphType> "hive";
<http://mu.semte.ch/graphs/personalGraph1> <mu:uuid> "PERSONALGRAPH1";
<foaf:name> "http://langens.jonathan/Personal-Graph-1";
<mu:graphType> "personal";
a <mu:Graph>.

<user/jonathan> mu:hasAccessToGraph <http://mu.semte.ch/graphs/personalGraph1>,
<http://mu.semte.ch/graphs/graph1>,
<http://mu.semte.ch/graphs/graph2>;
mu:uuid "JONATHANUUID";
mu:hasNode <node1>, <node2>, <node3>.

<node1> mu:forGraph <http://mu.semte.ch/graphs/personalGraph1>.
<node2> mu:forGraph <http://mu.semte.ch/graphs/graph1>; mu:hasParent <node1>.
<node3> mu:forGraph <http://mu.semte.ch/graphs/graph2>.


<user/aad> mu:hasAccessToGraph <http://mu.semte.ch/graphs/personalGraph2>,
<http://mu.semte.ch/graphs/graph1>,
<http://mu.semte.ch/graphs/graph2>;
mu:uuid "AADUUID";
mu:hasNode <node4>, <node5>, <node6>.

<node4> mu:forGraph <http://mu.semte.ch/graphs/personalGraph2>.
<node5> mu:forGraph <http://mu.semte.ch/graphs/graph1>; mu:hasParent <node1>.
<node6> mu:forGraph <http://mu.semte.ch/graphs/graph2>.

}


<user/erika> mu:hasAccessToGraph <http://mu.semte.ch/graphs/personalGraph3>,
<http://mu.semte.ch/graphs/graph1>,
<http://mu.semte.ch/graphs/graph2>;
mu:uuid "ERIKAUUID";
mu:hasNode <node7>, <node8>.

<node7> mu:forGraph <http://mu.semte.ch/graphs/personalGraph1>.
<node8> mu:forGraph <http://mu.semte.ch/graphs/graph2>.
}

0 comments on commit 62cb6f2

Please sign in to comment.