-
Notifications
You must be signed in to change notification settings - Fork 197
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
Make package.json be JSON-LD #39
Comments
An interesting idea, but we don't have enough time to come up with a standard context for package.json yet. Seems like some collaboration with npm would be good there as well. |
This is an interesting problem, indeed. Kind of takes me back to my first work with node.js: Which package.json? Which ontology? The up-and-comer in this space is SPDX, which DOAP now uses for licenses, and uses What about dependencies? Taking some liberties here, {
"name": "foo",
"version": "0.0.1",
"dependencies": {
"jsonld": "0.1.24"
}
} Into something with good URIs? Maybe something like this? [{
"@id": "https://npmjs.org/package/foo#0.0.1",
"http://usefulinc.com/ns/doap#release": "https://npmjs.org/package/foo#0.0.1"
},
{
"@id": "https://npmjs.org/package/foo#0.0.1",
"http://usefulinc.com/ns/doap#revision": "0.0.1",
"@type": [{"@id": "http://usefulinc.com/ns/doap#Version"}],
"http://usefulinc.com/ns/doap#dependency": "https://npmjs.org/package/jsonld#0.1.24"
}] |
<3 this idea! just invited other folks participating in W3C RDF JavaScript Libraries CG to tackle it together -- http://lists.w3.org/Archives/Public/public-rdfjs/2014Jan/0000.html |
we started discussing on a thread linked above how to describe people {
"@context": {
"url": "@id"
}
} possibly trying not to make dependencies a road block and start with more straight forward parts! |
@EDumbill http://npmjs.org has as of today
we could help with making them proper DOAP by crafting JSON-LD context and one page with few guidelines what to keep in mind while writing package.json i could also talk with npm community to make it an option in |
npm init option is smart On Fri, Jan 3, 2014 at 8:29 AM, ☮ elf Pavlik ☮ notifications@github.comwrote:
+1 (415) 692 1767 • http://about.me/edd • http://google.com/+EddDumbill |
i've just started writing down DOAP based context at: https://github.com/edumbill/doap/wiki/JSON-LD-@context-for-package.json |
@EDumbill i like the on-demand service idea... it's too bad there isn't a blessed avenue for this kind of automation, as discussed here. @elf-pavlik starting is always good! I added I've been playing with the playground (and the experimental one with syntax highlighting), and looking at some example package.json documents: issues encountered so far:
"name": "doap:name",
"author": {
"@id": "doap:maintainer",
"@type": "foaf:Person",
"name": "foaf:name",
"url": {
"@id": "foaf:homepage",
"@type": "@id"
}
}, well, it parses, but does nothing useful with the content it finds. still tinkering... |
Poking about a bit more in the npm source, and on some of the things that are exposed on registry.npmjs.org, I think what may make sense initially is to describe with a JSON-LD context the output of the registry, which has already been cleaned up, rather than try to work with/against the authors of individual Continuing with my examples from above, here are Here are some assertions (based on maybe wrong assumptions):
|
See also: |
http://linkedsoftwaredependencies.org/bundles/npm/jsonld https://linkedsoftwaredependencies.org/
It looks like @rubensworks works on it |
Indeed, we ( @joachimvh, @RubenVerborgh and myself) are working on this. Note that our mapped JSON-LD does not exactly correspond to the structure of the original package.json, because some parts are not directly convertable. @joachimvh did most of the work on this part, so he can provide further details on this. |
One of the problems we had with only attaching a context file to the package.json was that many package.json files contained custom tags added by the creators which could cause conflicts. E.g. if 2 tags were mapped to Another reason we did some rewrites was to increase the number of URIs generated. E.g., the author field is just a string (or an object with name/e-mail). For those we tried to generate consistent unique URIs so an author of multiple packages could easily be linked between those packages. |
Looking at: http://linkedsoftwaredependencies.org/bundles/npm/jsonld {
"@context": [
"https://linkedsoftwaredependencies.org/contexts/npm.jsonld"
],
"@graph": [
{
"_id": "jsonld",
"name": "jsonld",
"description": "A JSON-LD Processor and API implementation in JavaScript.",
"versions": {
"0.0.1": "https://linkedsoftwaredependencies.org/bundles/npm/jsonld/0.0.1",
...
"0.5.13": "https://linkedsoftwaredependencies.org/bundles/npm/jsonld/0.5.13"
},
"readme": "https://linkedsoftwaredependencies.org/bundles/npm/jsonld/README",
"maintainers": [
{
"email": "mailto:dil@lehn.org",
"@id": "https://linkedsoftwaredependencies.org/users/npm/davidlehn"
},
{
"email": "mailto:dlongley@digitalbazaar.com",
"@id": "https://linkedsoftwaredependencies.org/users/npm/dlongley",
"foaf:name": "Dave Longley"
},
{
"email": "mailto:mcollier@digitalbazaar.com",
"@id": "https://linkedsoftwaredependencies.org/users/npm/mattcollier"
},
{
"email": "mailto:msporny@digitalbazaar.com",
"@id": "https://linkedsoftwaredependencies.org/users/npm/msporny"
}
],
"author": {
"email": "mailto:support@digitalbazaar.com",
"@id": "mailto:support@digitalbazaar.com",
"foaf:name": "Digital Bazaar, Inc.",
"foaf:homepage": "http://digitalbazaar.com/"
},
"repository": {
"@id": "git+ssh://git@github.com/digitalbazaar/jsonld.js.git",
"@type": "doap:GitRepository"
},
"homepage": "http://github.com/digitalbazaar/jsonld.js",
"keywords": [
"JSON",
"Linked Data",
"JSON-LD",
"RDF",
"Semantic Web",
"jsonld"
],
"contributors": [
{
"email": "mailto:dlongley@digitalbazaar.com",
"@id": "https://linkedsoftwaredependencies.org/users/npm/dlongley",
"foaf:name": "Dave Longley"
}
],
"bugs": {
"url": "https://github.com/digitalbazaar/jsonld.js/issues",
"email": "support@digitalbazaar.com"
},
"license": {
"@id": "https://spdx.org/licenses/BSD-3-Clause.html",
"spdx:name": "BSD-3-Clause"
},
"@id": "https://linkedsoftwaredependencies.org/bundles/npm/jsonld",
"dcterms:license": {
"@id": "https://spdx.org/licenses/BSD-3-Clause.html",
"rdfs:label": "BSD-3-Clause"
},
"owl:sameAs": "https://www.npmjs.com/package/jsonld",
"@type": "doap:Project",
"created": "2012-09-05T17:11:42.229Z",
"modified": "2017-10-05T21:47:15.029Z"
},
{
"@id": "https://linkedsoftwaredependencies.org/bundles/npm/jsonld/0.4.12",
"npm:dist-tag": "latest"
},
{
"@id": "https://linkedsoftwaredependencies.org/bundles/npm/jsonld/0.5.13",
"npm:dist-tag": "dev"
}
]
} With
|
Nice. This is very similar to the GitHub API (v4) https://developer.github.com/v4/reference/object/repository/ |
Closing as not actionable here -- an interesting idea but no need to be a long standing open issue in this repo. |
On the eat-your-own-dogfoot principle, shouldn't
https://github.com/digitalbazaar/jsonld.js/blob/master/package.json
Have a context tag added?
Feel free to close this item without resolution as out of scope. But I thought it would make a nice example. And I need to generate some rdf from package.jsons for another project it would be good to have a standard context here.
The text was updated successfully, but these errors were encountered: