Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace for routes specification #15

Open
labra opened this issue Mar 4, 2020 · 10 comments
Open

Namespace for routes specification #15

labra opened this issue Mar 4, 2020 · 10 comments

Comments

@labra
Copy link
Contributor

labra commented Mar 4, 2020

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
Copy link
Contributor

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
Copy link

timbl commented Mar 8, 2020

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
Copy link
Contributor Author

labra commented Mar 9, 2020

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
Copy link
Contributor Author

labra commented Mar 9, 2020

@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
Copy link

timbl commented Mar 10, 2020

@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
Copy link

timbl commented Mar 10, 2020

Suggest people use that instead of the hackdiary one.

@labra
Copy link
Contributor Author

labra commented Mar 11, 2020

@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:

  • gpx:version
  • gpx:creator
  • gpx:lat
  • gpx:lon
  • gpx:id
  • gpx:domain
  • gpx:href
  • gpx:author
  • gpx:minlat
  • gpx:minlon
  • gpx:maxlat
  • gpx:maxlon

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
Copy link

timbl commented Mar 11, 2020

(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
Copy link

timbl commented Mar 11, 2020

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

@timbl
Copy link

timbl commented Mar 11, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants