Comments (9)
+1
from dali.
While I agree that UR[I]dentifiers would benefit a standardised xtype (#16), I wonder if standardising one for uu[id]entifiers is needed. I guess is the usual balance/threshold issue of reserving a word versus fixing it in a standard...
from dali.
UUID values have rules on what they can contain and a standard RFC 4122 for serializing them, so an xtype would mean the values can be validated.
from dali.
@pdowler would this xtype apply to datatype=long[4]
, char[36]
or either ?
from dali.
I use datatype="char" arraysize="36" xtype='uuid" because it makes reading a query result in text and using uuid values in queries much simpler, cut&paste, etc.
And yes, using canonical ascii form as described in the above RFC.
from dali.
In response to Marco: for my usage of xtype="uuid" it allows my VOTable parser to convert the chars into a UUID object rather than String. Without it, I would have to do the string-to-uuid in more code, potentially every piece of client code that encounters UUIDs.... and try to consistently deal with failure of the implicit validation (detect errors). So it makes my code better and if someone else cares about UUID it makes their code better. And as usual, if some other software doesn't know or care about xtype="uuid" they still get a string.
Without that xtype, I'd have to use something like xtype="opencadc:uuid" and no one else would gain the benefit.
Aside from our internal usage (caom2, storage-inventory, vospace, numericid for users), I'm seeing UUID more and more in other systems, for example OIDC sub
.
from dali.
Silly question, but are xtypes explicitly tied to a particular representation (so you couldn't have the same xtype for a UUID for char[36]
and datatype=long[4]
, or if there were to be a 128bit int type), or is that something that might be assumed by parsers?
from dali.
In the case of xtype="uuid", one could unambiguously allow for any of:
datatype="char" arraysize="36" aka canonical hex representation
datatype="long" arraysize="2" aka lower and upper bits in that order
datatype="byte" arraysize="16" aka raw bytes
Clients could in principle parse any such values into a UUID object, so as output (in a VOTable column) all of those are usable and could co-exist.
As input (via an HTTP parameter or in an ADQL query) a service can only really say that it accepts one of those (eg datalink service descriptor) or that the column in the tap_schema is one of those types. In that context I always found char to be the most convenient: no url encoding needed for params, simple quoted string used in ADQL queries, and can generally cut&paste values without strange failures.
So, to actually answer the question: xtypes do specify a serialization that applies to values in VOTable, HTTP parameters, etc and we usually pick one serialization that works well in those places. We could allow for other serializations but it would have to add something useful.
A secondary concern is that the values should in principle be usable by s/w that doesn't grok the xtype. For example, if I have a tap service and a column is a primary key of xtype="uuid" I think datatype="char" makes that PK column more or less equally usable to a client that doesn't know what a uuid is - it's a little less type safe but that's all. Arrays of byte or long as a PK would be more complex for minimal benefit.
from dali.
PR #24
from dali.
Related Issues (20)
- new xtype="words"
- new xtype="phrases" HOT 4
- xtype="range" HOT 1
- new xtype="uri" HOT 2
- vocabulary for "xtype" ? HOT 1
- add xtype(s) to support polymorphic values
- Add data origin in VOTable output
- Case sensitive params HOT 1
- New xtypes for sexagesimal angles HOT 3
- Update reference to RDF examples vocabulary HOT 1
- promote xtype section in doc HOT 3
- add xtype(s) for disjoint intervals and polygons HOT 1
- new xtype="json" HOT 25
- Include YAML as well as JSON HOT 4
- Multipolygon delimiter format/examples HOT 1
- Unions of interval, circle, etc
- OVERFLOW query status too tightly linked to MAXREC param
- multipolygon considered unnecessary HOT 3
- HTTP Accept header HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dali.