Arquisoft / viadeSpec

Viade Data Model Specification
https://arquisoft.github.io/viadeSpec/
MIT License
7 stars 1 forks source link

Namespace for routes specification #15

Open labra opened 4 years ago

labra commented 4 years ago

It is important to define a proper namespace for the different properties and types.

One possibility is to define our own namespace, something like: http://arquisoft.github.io/viadeSpec/ where we could define the new properties defined for viadeSpec.

Another possibility could be to define properties according to other formats like GPX and to adopt a more general namespace for them.

One possibility, suggested by @timbl here could be to ask the W3C to create something like: https://www.w3.org/ns/pim/gpx# and to populate that namespace with the gpx properties.

luispc1998 commented 4 years ago

I don't clearly understand what this namespace will be used for. Currently I'm considering as an importing point a normal .gpx file, that is one that follows the standard. If what is being suggested is that we should populate the .gpx with information of our app I strongly disagree. I believe that extra information should be provided when using the app (a form, or whatever) and should be recorded and saved by means of the viadeSpec that is currently being discussed.

timbl commented 4 years ago

I have put a placeholder file at https://www.w3.org/ns/pim/gpx.n3 (also .ttl,rdf)

I imagine this would be use for RDF arcs converted directly from GPX files, and the namespace would refer to that standard. So where any app needs the semantics of those properties it could use that ontology.

labra commented 4 years ago

I have created a possible ShEx schema for gpx converting the XML Schema specification for gpx 1.1. The translation from XML Schema to ShEx was straightforward with the only exception of the ordered points which I modelled using RDF lists.

As an example, this GPX file obtained from Wikipedia could be represented in Turtle as:

prefix :    <http://example.org/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix gpx: <https://www.w3.org/ns/pim/gpx#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>

:myRoute 
 gpx:metadata [ 
  gpx:link [
   gpx:href "http://www.garmin.com"^^xsd:anyURI ;
   gpx:text "Garmin International" ;
  ] ;
  gpx:time "2009-10-17T22:58:43Z"^^xsd:dateTime ;
 ] ;
 gpx:trk [
 gpx:name "Example GPX Document" ;
 gpx:trkseg [
  gpx:trkpts ( 
   [ gpx:trkpt [ 
     gpx:lat  47.644548 ;
     gpx:lon -122.326897 ;
     gpx:ele  4.46 ;
     gpx:time "2009-10-17T18:37:26Z"^^xsd:dateTime
    ]
   ] 
   [ gpx:trkpt [ 
     gpx:lat  47.644548 ;
     gpx:lon -122.326897 ;
     gpx:ele  4.94 ;
     gpx:time "2009-10-17T18:37:26Z"^^xsd:dateTime
    ]
   ] 
   [ gpx:trkpt [ 
     gpx:lat  47.644548 ;
     gpx:lon -122.326897 ;
     gpx:ele  6.87 ;
     gpx:time "2009-10-17T18:37:26Z"^^xsd:dateTime
    ]
   ] 
  )
 ] 
] .
labra commented 4 years ago

@luispc1998 the idea of namespaces is that you can combine in Turtle elements from different namespaces easily. At the end, must nodes in Turtle are just URIs and namespaces are a mechanism to simplify those URIs.

The idea of defining a gpx namespace is that you can use entities from that namespace in your app. So, for example, for the viadeSpec we could combine entities that we specifically defined for Viade with entities from the gpx namespace.

For example, we could use something like:

prefix :   <http://example.org/> 
prefix viade: <http://arquisoft.github.io/viadeSpec/>
prefix schema: <http://schema.org/>
prefix xsd:    <http://www.w3.org/2001/XMLSchema#>
prefix gpx:   <https://www.w3.org/ns/pim/gpx#>

:exampleRoute schema:name   "A nice walk" ;
 viade:gpx [ 
  gpx:trk [
    gpx:trkseg [
      gpx:trkpts ( 
       [ gpx:trkpt [ 
           gpx:lat  47.644548 ;
           gpx:lon -122.326897 ;
           gpx:ele  4.46 ;
           gpx:time "2009-10-17T18:37:26Z"^^xsd:dateTime
      ]] 
      [ gpx:trkpt [ 
          gpx:lat  47.644548 ;
          gpx:lon -122.326897 ;
          gpx:ele  4.94 ;
          gpx:time "2009-10-17T18:37:26Z"^^xsd:dateTime
      ]] 
      [ gpx:trkpt [ 
          gpx:lat  47.644548 ;
          gpx:lon -122.326897 ;
          gpx:ele  6.87 ;
          gpx:time "2009-10-17T18:37:26Z"^^xsd:dateTime
      ]]  )
   ]
  ]
 ]
. 

which combines elements from viade namespace, from gpx namespace and from schema namespace.

timbl commented 4 years ago

@prefix gpx: <http://www.w3.org/ns/pim/gpx#> .

This namespace now has some hacked together namespace support with comments imported from the XML schema

timbl commented 4 years ago

Suggest people use that instead of the hackdiary one.

labra commented 4 years ago

@timbl Great!

I was looking at it and I think the attributes in XML Schema are missing. For example: gpx:version, gpx:creator, gpx:domain, etc. Those properties appear as attributes in the XML Schema and I modeled them as properties.

The list of missing attributes/properties is:

Some of those attributes could be represented with properties from other namespaces. For example: gpx:lat and gpx:lon could be defined reusing the wgs_84 properties: wgs_84:lat and wgs_84:long instead, but in that case we should not use gpx:ele and use wgs_84:alt.

timbl commented 4 years ago

(Yes, @luispc1998 that idea that a typical file or message in a system will include a mixture of languages at the same time and that is not weird just normal is wha I tried to convey in a talk about a bag of chips (text). a while ago

timbl commented 4 years ago

I have made a rep for the GPX ontology. PRs welcome, maintainers?

timbl commented 4 years ago

https://github.com/linkeddata/gpx-ontology