diff --git a/main/gpx.bs b/main/gpx.bs index 88bbb24..daedf4f 100644 --- a/main/gpx.bs +++ b/main/gpx.bs @@ -1,11 +1,11 @@ ## GPX Routes ## {#gpx} -[[GPX]] is a popular XML format that could be used to represent routes. There are two possibilities: to convert the XML format to Turtle or - to embed the XML file as an RDF literal. +[[GPX]] is a popular XML format that could be used to represent routes. There are two possibilities: to convert the XML format to Turtle or + to embed the XML file as an RDF literal. ### GPX Routes converted to Turtle ### {#gpxTurtle} -GPX routes can be represented in Turtle using the following Shape Expression: +GPX routes can be represented in Turtle using the following Shape Expression:
path: dataModel.bs
path: gpx.bs+
path: jsonldProposal/podManagement.bs+ diff --git a/main/jsonldProposal/commentExample.json b/main/jsonldProposal/commentExample.json new file mode 100644 index 0000000..21625a9 --- /dev/null +++ b/main/jsonldProposal/commentExample.json @@ -0,0 +1,34 @@ +{ + "@context": { + "@version": 1.1, + "comments": { + "@container": "@list", + "@id": "viade:comments" + }, + "dateCreated": { + "@id": "viade:dateCreated", + "@type": "xsd:date" + }, + "text": { + "@id": "viade:text", + "@type": "xsd:string" + }, + "viade": "http://arquisoft.github.io/viadeSpec/", + "xsd": "http://www.w3.org/2001/XMLSchema#" + }, + "comments": [ + { + "text": "This is just a example !!", + "dateCreated": "2004-04-12" + }, + { + "text": "This is just a example 3425!!", + "dateCreated": "2005-04-12" + }, + { + "text": "This is just a example 2 !!", + "dateCreated": "2006-04-12" + } + ] + +} \ No newline at end of file diff --git a/main/jsonldProposal/jsonldExample.json b/main/jsonldProposal/jsonldExample.json new file mode 100644 index 0000000..0e75722 --- /dev/null +++ b/main/jsonldProposal/jsonldExample.json @@ -0,0 +1,147 @@ +{ + "@context": { + "@version": 1.1, + "comments": { + "@id": "viade:comments", + "@type": "@id" + }, + "description": { + "@id": "schema:description", + "@type": "xsd:string" + }, + "media": { + "@container": "@list", + "@id": "viade:media" + }, + "name": { + "@id": "schema:name", + "@type": "xsd:string" + }, + "points": { + "@container": "@list", + "@id": "viade:points" + }, + "latitude": { + "@id": "schema:latitude", + "@type": "xsd:double" + }, + "longitude": { + "@id": "schema:longitude", + "@type": "xsd:double" + }, + "elevation": { + "@id": "schema:elevation", + "@type": "xsd:double" + }, + "author":{ + "@id": "schema:author", + "@type": "@id" + }, + "date": { + "@id": "schema:DateTime", + "@type": "xsd:dateTime" + }, + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "schema": "http://schema.org/", + "viade": "http://arquisoft.github.io/viadeSpec/", + "xsd": "http://www.w3.org/2001/XMLSchema#" + }, + "name": "Route test 1", + "author": "https://luispresacollada.solid.community/profile/card#me", + "description": "This is a test to see the output of the JsonLDConversor", + "comments": "http://inrupt.luispc1998/viade/comments/routeComments/commentExample.json", + "date": "2020-02-25T18:50:22Z", + "media": [ + { + "@id": "http://inrupt.luispc1998/viade/resources/da34fas749sa3h883j.jpg", + "name": "MyFoto" + }, + { + "@id": "http://inrupt.angelixus/viade/resources/pt92as74234a3h5xb3j.mp4", + "name": "MyVideo" + }, + { + "@id": "http://inrupt.raupemol/viade/resources/da34zas4213sa7b542.png", + "name": "OtherFoto" + }, + { + "@id": "http://inrupt.luispc1998/viade/resources/da345432jtsa7b542e.mp4", + "name": "OtherVideo" + } + ], + "waypoints" : [ + { + "name": "Name for the waypoint", + "description": "Description of the waypoint", + "latitude": 45.123, + "longitude": 34.121, + "elevation": 34 + }, + { + "name": "Computer Science School", + "description": "Become a good engineer with us", + "latitude": 45.123, + "longitude": 34.121, + "elevation": 34 + } + + ], + "points": [ + { + "latitude": 45.123, + "longitude": 34.121, + "elevation": 34 + }, + { + "latitude": 46.123, + "longitude": 34.121, + "elevation": 36 + }, + { + "latitude": 47.123, + "longitude": 34, + "elevation": 39 + }, + { + "latitude": 48.123, + "longitude": 32.121, + "elevation": 40 + }, + { + "latitude": 49.123, + "longitude": 34.121, + "elevation": 43 + }, + { + "latitude": 40.123, + "longitude": 32.121, + "elevation": 46 + }, + { + "latitude": 50.123, + "longitude": 33.121, + "elevation": 50 + }, + { + "latitude": 53.123, + "longitude": 34.121, + "elevation": 55 + }, + { + "latitude": 54.123, + "longitude": 34.121, + "elevation": 56 + }, + { + "latitude": 55.123, + "longitude": 35.121, + "elevation": 50 + }, + { + "latitude": 55.123, + "longitude": 34.121, + "elevation": 45 + } + ] +} \ No newline at end of file diff --git a/main/jsonldProposal/podManagement.bs b/main/jsonldProposal/podManagement.bs new file mode 100644 index 0000000..e40256f --- /dev/null +++ b/main/jsonldProposal/podManagement.bs @@ -0,0 +1,114 @@ +Pod Management {#podManagement} +===================== + +It is crucial for the interoperability that we handle the POD data in the same way. Here is a proposal of what we can do. Note that this pretends to be an +starting point to the complete specification, and so it is open to discussion. + +## File format ## {#fileFormat} +For the file format we can use JSON-LD, we have used JSON along the degree and we are very familiar with it, +it won't be a problem to handle that in the application, in fact Javascript facilitates that task with the built-in object "JSON". + + +### File example ### {#fileExample} +What comes next is an example of the **minimum** data that should be stored in the pod with the JSON-LD. More data could be added by our apps, +but at least this should be there. + +The following properties can be found: + +* name: the name of the route. +* author: the webId of the creator of the route (optional). +* description: a description of the route (optional). +* waypoints: a list of waypoints (optional). +* points: points of the route, describing the path. +* comments: a link (@id) to a file related with the route where the links to the users comments will be stored. +* date: the date of creation of the route (optional). +* media: a list of links to resources. Also contains the optional property "name" for each media element. + +The example (if any error is seen in the context, please point it out): + +_If it cannot be seen in the include please check it manually because afterwards there will be mentions about it._ +
path: jsonldProposal/jsonldExample.json+ +## Directory hierarchy in the POD ## {#directoryHierarchy} +Not only we need to state what information should be in the pod, but also where it is located. + +We proposed a "viade" folder in the root of the pod, and inside it three folders: routes, comments, resources. + +
+ +viade/ + + routes/ + + example.jsonld + example2.jsonld + + comments/ + + myComments/ + userComment.jsonld + userComment2.jsonld + + routeComments/ + ruta1Comments.jsonld + ruta2Comments.jsonld + + resources/ + + foto.jpg + image.png + video.mp4 + + inbox/ + + sharingNotification1.jsonld + sharingNotification2.jsonld + + shared/ + + luispresacollada.solid.community.jsonld + ++ +### Comments and resources ### {#resources} +These two are thought to be in the pod of the user that truly owns them, therefore, a user will have in its pod comments and resources that will +be referenced from other routes (it is a graph, the file will be in many places) + +We are considering two different folders even though they are just references because the way we would treat them, we may even not display those two groups +at the same time. + + +Due to the fact that we should allow other users to comment the routes, but we cannot let them edit the route file that leaded to the following approach. +Routes should have a link to a file that stores links to the comments of the users that commented. Consider the following example: + +Luis published a route long ago, and now he shared it with his friend Sara. Sara wants to comment it. The application will create the comment in Sara's POD, because it's +her comment, and it will read from the route file its assigned file to comment (We are on Luis' POD), there it will write a link to Sara's comment in Sara's POD. These process +need to divide the comments folder into two subfolders: myComments and routeComments. + +myComments will store the user's comments, in our previous example, Sara will write her comment in the directory viade/comments/myComments/ of her POD. + +routeComments will store the files related with the routes, that have the links to the comments. In our previous example, Sara's app client will read in the shared route and locate +the comments file that will be in the directory viade/comments/routeComments/..., it will be a jsonLD file, and she will add here the link to the comment in her pod. + + +## What should be done about GPX? ## {#gpxToJson} +A gpx file can contain several elements "trk" (from the word "track") which are the ones that match our concept of "Route", that is a path, a sequence of points. Inside this label we can have +several "trkseg", which stand as sequences of ordered points (trkpt). Our duty will be to take all the trkpt and put them inside the "viade:points" property of the example json. + +The gpx trk label can have a name and a description so it could be direct translation. Or we may want the user to introduce that data, that's an app design decision. + +There is a type of points in a GPX called "waypoints", they are relevant points that are in some way related to the specified tracks. Assuming a path across a city, +a waypoint can be a church, a restaurant, a monument, and so far so forth. We will include this points in our routes jsonld files. They will have name, description and coordinates. +Check the provided example to see its implementation. Elevation and description are optional attributes. + + +## How to share ## {#share} +We have performed a voting in order to follow the approach of the permissions, or use the inbox folder in order to manipulate the sharing functionality. In the end we wil be using the second +one. But for such a task we need some kind of agreement in the file structure in the "receiver". Assume Luis wants to share a route with Sara. Luis will give her permissions to the files, +and send her a notification, with the webid of the route and his own webid. Sara's app will parse the notification and add that route id to a file. + +Such files will be placed in the folder viade/shared, and will have a name such as: luispresacollada.solid.community. (The corresponding part of the webID) +You may check the structure in the file "sharedRoutesExample", it contains a simple list with @id pointing to the shared routes. + +
path: jsonldProposal/sharedRoutesExample.json+ diff --git a/main/jsonldProposal/sharedRoutesExample.json b/main/jsonldProposal/sharedRoutesExample.json new file mode 100644 index 0000000..3c20d43 --- /dev/null +++ b/main/jsonldProposal/sharedRoutesExample.json @@ -0,0 +1,25 @@ +{ + "@context": { + "@version": 1.1, + "routes": { + "@container": "@list", + "@id": "viade:routes" + }, + "viade": "http://arquisoft.github.io/viadeSpec/" + }, + "routes": [ + { + "@id": "http://inrupt.luispc1998/viade/routes/route1.jsonld" + }, + { + "@id": "http://inrupt.angelixus/viade/routes/example.jsonld" + }, + { + "@id": "http://inrupt.raupemol/viade/routes/magicalRoute.jsonld" + }, + { + "@id": "http://inrupt.luispc1998/viade/routes/exampl2.jsonld" + } + ] + +} \ No newline at end of file