From fa8571d129acd21fd2c90a629d39191e4a2d8fd2 Mon Sep 17 00:00:00 2001 From: Wes Turner Date: Tue, 1 Dec 2015 22:12:59 -0600 Subject: [PATCH 1/3] DOC: unpublished/linkeddata: pep-XXX-linked-data-json-ld-rdf-rdfa.rst: first draft --- .../pep-XXX-linked-data-json-ld-rdf-rdfa.rst | 201 ++++++++++++++++++ .../schema.pypa.io-latest.context.jsonld | 1 + .../schema.pypa.io-v0.1.0.context.jsonld | 0 .../linkeddata/tests/pip-metadata.json | 0 .../linkeddata/tests/pip-metadata.json.jsonld | 0 5 files changed, 202 insertions(+) create mode 100644 unpublished/linkeddata/pep-XXX-linked-data-json-ld-rdf-rdfa.rst create mode 120000 unpublished/linkeddata/schema/schema.pypa.io-latest.context.jsonld create mode 100644 unpublished/linkeddata/schema/schema.pypa.io-v0.1.0.context.jsonld create mode 100644 unpublished/linkeddata/tests/pip-metadata.json create mode 100644 unpublished/linkeddata/tests/pip-metadata.json.jsonld diff --git a/unpublished/linkeddata/pep-XXX-linked-data-json-ld-rdf-rdfa.rst b/unpublished/linkeddata/pep-XXX-linked-data-json-ld-rdf-rdfa.rst new file mode 100644 index 0000000..6fc5767 --- /dev/null +++ b/unpublished/linkeddata/pep-XXX-linked-data-json-ld-rdf-rdfa.rst @@ -0,0 +1,201 @@ +PEP: XXX +Title: Linked Metadata for Python Software Packages +Version: $Revision$ +Last-Modified: $Date$ +Author: Wes Turner +BDFL-Delegate: +Discussions-To: + GitHub: https://github.com/pypa/interoperability-peps/issues/31 + Distutils SIG +Keywords: PEP426JSONLD, RDF, RDFa, JSON-LD, JSONLD, LinkedData, Linked +Data +Status: Draft +Type: Standards Track (?) +Content-Type: text/x-rst +Requires: 440, 426 (?) +Created: 1 Dec 2015 +Post-History: +Replaces: 345 (?) + + +.. contents:: + +Abstract +======== + +This PEP describes a mechanism for publishing and exchanging metadata +related to Python distributions. It includes specifics of the field names, +and their semantics and usage. + +* Version 1.0 is specified in PEP 241. +* Version 1.1 is specified in PEP 314. +* Version 1.2 is specified in PEP 345. + PEP 345 is to be considered the current (2015) packaging + metadata format. + +* Version 2.0 (draft) is specified in PEP 426 + PEP426 would/will significantly modify the JSON metadata + format; adding additional fields for e.g. source code metadata + and semantic dependencies. + +* Version 3.0 (1.2 + [2.0] + Linked Data) (draft) + is specified in this document. + + For purposes of practicality, because PEP 426 is still draft, + this PEP will strive to convert first Version 1.2 PEP 345 metadata + and then Version 2.0 (draft) PEP 426 metadata. + +Version 3.0 Would Require + +* metadata.json (Version 1.2 (345), Version 2.0 (426)) +* metadata.jsonld (in addition to the existing metadata.json) + + * [ ] lookup-optimized JSON metadata keys -> JSON-LD ``@context`` + +* schema.pypa.io JSONLD ``@context`` + + * + + +Definitions +============== + +Linked Data + Linked Data is data linked with URIs; preferably in a format + that is convertible to or already RDF (such as RDFa, JSON-LD, + Turtle/Trig) + + TODO: ld-glossary + +URI + A URI (*Uniform Resource Indicator*) is a namespaced + string with structured parts and delimiters + for naming or identifying a resource. + + TODO: example + +URN + TODO: example + +URL + A URL (*Uniform Resource Locator*) is a **URI** + identifying a retrievable resource. + + +RDF + RDF (*Resource Description Framework*) + +RDFa + RDFa (*RDF-in-attributes*) is an open W3C format for including + structured data inline with (presentational) HTML pages. + + * Search engines can and do parse RDFa (particularly with schema.org + types and property/attribute/column URIs) + +JSON-LD / #JSONLD + JSON-LD (*JSON Linked Data*) is a format + +Schema.org + ``__ is a standard RDFS vocabulary of classes and + properties for many different domains. + + * schema.org is maintained as RDFa; other formats are generated from + the source RDFa representation. + + TODO: link + + * schema.org supports an extension vocabulary model; suggesting + ``schema.[domain.tld]`` for URI namespaces and ``schema<...>:`` + for URI QNames (and URI CURIES). + + TODO: link + + +schema.org/SoftwareApplication + + http://schema.org/SoftwareApplication + +schema.org/Code + + http://schema.org/Code + + + +Features / Use Cases / TODO +============================= + +Version 3.0 Would Enable + +* Python Packaging RDF + + * | xmlns: https://schema.pypa.io + * | xmlns: ``schemapy:`` + + * @type: SoftwarePackage + + * @type: PythonPackage + + * @type: PythonPackageRelease + + * @type: Sdist + * @type: Bdist + * @type: Egg + * @type: Wheel + * @type: [Conda] + + * @type: Requirement + + * @type: PythonPackageRequirement + + * @type: Constraint + + * @type: PackageRepo + + * @type: PythonPackageRepo + + * @type: HostedPythonPackageRepo + + * eg: :ref:`PyPI` + * eg: :ref:`Warehouse` + * eg: [:ref:`DevPi`] + +* [ ] schema.pypa.io (a ``gh-pages`` branch. sphinx?) + +* [ ] Warehouse: metadata.jsonld extraction & indexing +* [ ] Warehouse: JSONLD HTTP GET views: + https://warehouse.python.org/project/pip/jsonld + +* [ ] Warehouse: JSONLD in the package [release] template: + https://warehouse.python.org/project/pip + + .. code:: html + + + +* [ ] Warehouse: RDFa in the package [release] template: + https://warehouse.python.org/project/pip + + +.. [1] reStructuredText markup: + http://docutils.sourceforge.net/ + +.. _PyPI: http://pypi.python.org/pypi/ + +.. _Warehouse: https://warehouse.python.org/ + + +Copyright +========= + +This document has been placed in the public domain. + + +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + End: diff --git a/unpublished/linkeddata/schema/schema.pypa.io-latest.context.jsonld b/unpublished/linkeddata/schema/schema.pypa.io-latest.context.jsonld new file mode 120000 index 0000000..54c9c0b --- /dev/null +++ b/unpublished/linkeddata/schema/schema.pypa.io-latest.context.jsonld @@ -0,0 +1 @@ +./schema.pypa.io-v0.1.0.context.jsonld \ No newline at end of file diff --git a/unpublished/linkeddata/schema/schema.pypa.io-v0.1.0.context.jsonld b/unpublished/linkeddata/schema/schema.pypa.io-v0.1.0.context.jsonld new file mode 100644 index 0000000..e69de29 diff --git a/unpublished/linkeddata/tests/pip-metadata.json b/unpublished/linkeddata/tests/pip-metadata.json new file mode 100644 index 0000000..e69de29 diff --git a/unpublished/linkeddata/tests/pip-metadata.json.jsonld b/unpublished/linkeddata/tests/pip-metadata.json.jsonld new file mode 100644 index 0000000..e69de29 From cc4e1407c5cee3dcc8c3181d67a7c4785f3400fb Mon Sep 17 00:00:00 2001 From: Wes Turner Date: Wed, 2 Dec 2015 00:18:38 -0600 Subject: [PATCH 2/3] BLD: Makefile: build, build-pep, open --- unpublished/linkeddata/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 unpublished/linkeddata/Makefile diff --git a/unpublished/linkeddata/Makefile b/unpublished/linkeddata/Makefile new file mode 100644 index 0000000..7c3689e --- /dev/null +++ b/unpublished/linkeddata/Makefile @@ -0,0 +1,14 @@ + +# Makefile +# + +default: build + +build: build-pep-XXX + +build-pep-XXX: + # ./pep-XXX-linked-data-json-ld-rdf-rdfa.rst > HTML + rst2html.py ./pep-XXX-linked-data-json-ld-rdf-rdfa.rst > pep-XXX-linked-data-json-ld-rdf-rdfa.rst.html + +open: + web ./pep-XXX-linked-data-json-ld-rdf-rdfa.rst.html From 19d43d273af2dfd2b9e602843b71589742743231 Mon Sep 17 00:00:00 2001 From: Wes Turner Date: Wed, 2 Dec 2015 00:20:06 -0600 Subject: [PATCH 3/3] DOC: pep-XXX-linked-data-json-ld-rdf-rdfa.rst: more draft work, HTML rendering --- .../pep-XXX-linked-data-json-ld-rdf-rdfa.rst | 203 +++++++++++++----- 1 file changed, 150 insertions(+), 53 deletions(-) diff --git a/unpublished/linkeddata/pep-XXX-linked-data-json-ld-rdf-rdfa.rst b/unpublished/linkeddata/pep-XXX-linked-data-json-ld-rdf-rdfa.rst index 6fc5767..682c1ad 100644 --- a/unpublished/linkeddata/pep-XXX-linked-data-json-ld-rdf-rdfa.rst +++ b/unpublished/linkeddata/pep-XXX-linked-data-json-ld-rdf-rdfa.rst @@ -3,10 +3,8 @@ Title: Linked Metadata for Python Software Packages Version: $Revision$ Last-Modified: $Date$ Author: Wes Turner -BDFL-Delegate: -Discussions-To: - GitHub: https://github.com/pypa/interoperability-peps/issues/31 - Distutils SIG +BDFL-Delegate: - +Discussions-To: GitHub: https://github.com/pypa/interoperability-peps/issues/31 , Distutils SIG Keywords: PEP426JSONLD, RDF, RDFa, JSON-LD, JSONLD, LinkedData, Linked Data Status: Draft @@ -14,11 +12,11 @@ Type: Standards Track (?) Content-Type: text/x-rst Requires: 440, 426 (?) Created: 1 Dec 2015 -Post-History: +Post-History: Replaces: 345 (?) -.. contents:: +.. contents:: Abstract ======== @@ -33,7 +31,7 @@ and their semantics and usage. PEP 345 is to be considered the current (2015) packaging metadata format. -* Version 2.0 (draft) is specified in PEP 426 +* Version 2.0 (draft) is specified in PEP 426. PEP426 would/will significantly modify the JSON metadata format; adding additional fields for e.g. source code metadata and semantic dependencies. @@ -42,9 +40,10 @@ and their semantics and usage. is specified in this document. For purposes of practicality, because PEP 426 is still draft, - this PEP will strive to convert first Version 1.2 PEP 345 metadata - and then Version 2.0 (draft) PEP 426 metadata. - + this PEP will strive to transform first Version 1.2 PEP 345 metadata + and then Version 2.0 (draft) PEP 426 metadata into `JSON-LD`_ (and + thereby `RDF`_). + Version 3.0 Would Require * metadata.json (Version 1.2 (345), Version 2.0 (426)) @@ -54,7 +53,7 @@ Version 3.0 Would Require * schema.pypa.io JSONLD ``@context`` - * + * Definitions @@ -62,10 +61,11 @@ Definitions Linked Data Linked Data is data linked with URIs; preferably in a format - that is convertible to or already RDF (such as RDFa, JSON-LD, + that is transformable to or already RDF (such as RDFa, JSON-LD, Turtle/Trig) - TODO: ld-glossary + * The Linked Data glossary contains + term definitions for many Linked Data Concepts [`LD-GLOSSARY`_]. URI A URI (*Uniform Resource Indicator*) is a namespaced @@ -80,10 +80,10 @@ URN URL A URL (*Uniform Resource Locator*) is a **URI** identifying a retrievable resource. - + RDF - RDF (*Resource Description Framework*) + RDF (*Resource Description Framework*) [`RDF`_] RDFa RDFa (*RDF-in-attributes*) is an open W3C format for including @@ -92,8 +92,9 @@ RDFa * Search engines can and do parse RDFa (particularly with schema.org types and property/attribute/column URIs) -JSON-LD / #JSONLD - JSON-LD (*JSON Linked Data*) is a format +JSON-LD + JSON-LD (*JSON Linked Data*) is a format TODO [`JSON-LD`_, + `JSON-LD-1.0`_] Schema.org ``__ is a standard RDFS vocabulary of classes and @@ -124,40 +125,9 @@ Features / Use Cases / TODO Version 3.0 Would Enable -* Python Packaging RDF - - * | xmlns: https://schema.pypa.io - * | xmlns: ``schemapy:`` - - * @type: SoftwarePackage - - * @type: PythonPackage - - * @type: PythonPackageRelease - - * @type: Sdist - * @type: Bdist - * @type: Egg - * @type: Wheel - * @type: [Conda] - - * @type: Requirement - - * @type: PythonPackageRequirement - - * @type: Constraint +* `Python Packaging RDF`_ - * @type: PackageRepo - - * @type: PythonPackageRepo - - * @type: HostedPythonPackageRepo - - * eg: :ref:`PyPI` - * eg: :ref:`Warehouse` - * eg: [:ref:`DevPi`] - -* [ ] schema.pypa.io (a ``gh-pages`` branch. sphinx?) + * [ ] schema.pypa.io (a ``gh-pages`` branch. sphinx?) * [ ] Warehouse: metadata.jsonld extraction & indexing * [ ] Warehouse: JSONLD HTTP GET views: @@ -167,7 +137,7 @@ Version 3.0 Would Enable https://warehouse.python.org/project/pip .. code:: html - +