-
Notifications
You must be signed in to change notification settings - Fork 4
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
Why definitions using .js files? #6
Comments
hey @pmackay. we're using |
IMO vocab should not assume any particular programming language! At he same time using JSON-LD similar to hydra-core makes sense to me. I offer my help with starting to write agent.jsonld 👷 |
I think what would be great to make this vocab more accessible is data model documentation along the lines of http://www.popoloproject.com/. (I'm working on a similar thing here http://communitiesuk.github.io/waste-service-standards/models/ for the wildly exciting domain of local gov waste services). |
@pmackay - I know more than one person who is wildly excited by waste services (actually, recycling). But seriously, when the model here gets nailed down, we should do what you propose. And if you can help, having done it before, that would be even better! |
@bhaugen if you know anyone who might want to feed into specifications for recycling services, please connect us. Any input is very useful. Happy to help if I can. The site I'm using/building is available here https://github.com/communitiesuk/waste-service-standards (I need to add docs on how its built). Uses http://www.mkdocs.org/, very nice project. |
@elf-pavlik @pmackay: keen. :)
agreed. the plan in my head has always been to write npm scripts that use the modified json schemas in the
yes! is json-schema an appropriate description to generate such data model documentation, or is there a better format? if we can agree on json-schema, a module to do json-schema to html documentation would be sweet. 🍯 |
AFAIK JSON Schema takes Closed-world Assumption, while Linked Data/RDF work with Open-world Assumption. With such mismatch I don't think we can use JSON Schema to define Linked Data vocabulary... |
@elf-pavlik I confess I'd need to see that explained with an example to understand the problem as you've described it there :-O |
@elf-pavlik the way we're using JSON schema, by describing modular data models, seems to work really well for Linked Data/RDF. JSON schema by default assumes objects can have additional properties unless you specify additionalProperties is |
@ahdinosaur does it also assume that any property can have as its value an object of certain type or array of such objects? {
"name": "elf Pavlik",
"seeks": { "@type": "Demand", "name": "foo" }
} {
"name": [ "elf Pavlik", "elf-pavlik" ],
"seeks": [
{ "@type": "Demand", "name": "foo" },
{ "@type": "Demand", "name": "bar" }
]
} |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"Demand": {
"type": "object",
"properties": {
"@type": {
"type": "string",
"enum": ["Demand"]
},
"name": {
"type": "string"
}
}
}
},
"type": "object",
"properties": {
"name": {
"type": "string"
},
"seeks": {
"anyOf": [{
"type": "array",
"items": {
"$ref": "Demand"
}
}, {
"$ref": "Demand"
}]
}
}
} i'm keen for a better solution, but JSON schema seems like the best interchange format that most of us are already using, it's simple and works well. in my own projects i intend to modify it with some sugar but i'll export it back to standard, or include any modifications that we all agree on (most likely additional meta-data related to Linked Data / RDF). |
{
"properties": {
"name": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
]
},
"seeks": {
"anyOf": [
{ "$ref": "Demand" },
{ "type": "array", "items": { "$ref": "Demand" } }
]
}
}
} etc. not to mention missing in your example {
"properties": {
"@type": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
]
}
} |
@pmackay - you might try Adam Johnson of Garbologie: |
@ahdinosaur does JSON-Schema have any support for language maps for Literals (strings)? |
@elf-pavlik true. that's why i'm keen to programmatically construct the standard JSON schemas from a modified, more opinionated JSON schema targeted at Linked Data / RDF. i've started schema-jsonld-context for converting our schema to
if not JSON schema, is there a description and validation language we can use as an alternative? |
I would propose starting with JSON-LD file which uses RDFS & OWL for vocab definitions. When it comes to validations and form generations we may need to catch up on work in Data Shapes WG |
@ahdinosaur I need to understand why to even think about any other intermediate step. And if we are using some intermediate step, why to publish any of that, it seems to mostly have caused confusion? (I'm pretty sure I am missing something in the thinking since I am so new to this, so at this point asking just for information so I can even have an opinion.) For example, for NRP, the library we installed takes in rdf triples and serializes it to json-ld output. But there is no place I would put those rdf triples for public viewing. And I created the context basically from examples and scratch, and although I didn't have time yesterday, these can be valicated using the jsonld playground, and of course when we do a pilot. I'm thinking that what we need to publish is
Is there anything else? What am I missing? |
@elf-pavlik sorry missed your post with mine, will check those too |
@ahdinosaur see the gitter conversation... elf trying to ping us.... |
that sounds great, let's do it. :)
my other stuff is mad science for a single source of truth that generates all derivative truths, it's meant to be take in js schemas and output human and machine readable content, such as a context file in json-ld format or a webpage such as api projects do or object validation or database models or html forms or form validation or ... feel free to ignore those files if it's confusing, maybe it'll make more sense once i do something more useful. |
let's resolve it in valueflows/valueflows#35 |
I'm just curious why this vocab definition is defining objects using
.js
files? What about just using JSON schema files to define simple objects?The text was updated successfully, but these errors were encountered: