THE SPDX WIKI IS NO LONGER ACTIVE. ALL CONTENT HAS BEEN MOVED TO https://github.com/spdx

Technical Team/Proposals/2013-Dec-12 2.0 Tag Format Turtle

From SPDX Wiki
< Technical Team‎ | Proposals
Revision as of 20:27, 2 December 2013 by Goneall (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Background

In SPDX 2.0, a richer format for describing the relationship between SPDX elements will need to be created. The current tag/value syntax will not be sufficient. For example, an SPDX document may contain a nesting of several packages and each package (or file within the package) may make a reference(s) to other packages and files both inside and outside the SPDX document.

One alternative is to devise a language with nesting and external references and standardize that within the SPDX working group.

This proposal is to leverage the existing RDF Turtle language which is standardized by W3C and is designed for readability. From the W3C Turtle abstract: "This document defines a textual syntax for RDF called Turtle that allows RDF graphs to be completely written in a compact and natural text form...". See the Turtle Submission for more information. A draft tutorial for Turtle can be found here: http://www.w3.org/2007/02/turtle/primer/.

Proposal

Utilize the Turtle output for a standard RDF graph of the SPDX document with minimal post processing to improve the readability. Certain conventions should be followed to improve the readability. The SPDX tools would be updated to follow the conventions and provide the appropriate pre/post processing.

Post Processing Proposals

  1. Remove the namespace definitions
  2. Replace full URL references to SPDX standard licenses with just the SPDX license ID.

Conventions for RDF Turtle

  1. Use namespace names "spdx", "rdf", "doap", and "rdfs"
  2. Use base and explicit node names so that license ID's can be used for the node references (exact mechanics of this TBD)
  3. Use the explicit "rdf:typeof" rather than the shortand "a"

Open Issues

  1. Use of standard license ID's rather than the full URL - there does not seem to be a way to resolve this with the namespaces. This would eliminate the post-processing of standard license ID's

Example

<http://www.uri.com#SPDXANALYSIS?package>

     rdf:typeof spdx:Package ;
     spdx:checksum
             [ rdf:typeof spdx:Checksum ;
               spdx:algorithm spdx:checksumAlgorithm_sha1 ;
               spdx:checksumValue "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"
             ] ;
     spdx:copyrightText "Copyright 2010, 2011 Source Auditor Inc." ;
     spdx:description "This utility translates and SPDX RDF XML document to a spreadsheet, translates a spreadsheet to an SPDX RDF XML document and translates an SPDX RDFa document to an SPDX RDF XML document." ;
     spdx:downloadLocation
             "http://git.spdx.org/?p=spdx-tools.git;a=summary" ;
     spdx:hasFile _:b1 , _:b2 , _:b3 ;
     spdx:licenseComments
             "The declared license information can be found in the NOTICE file at the root of the archive file" ;
     spdx:licenseConcluded
             [ rdf:typeof spdx:ConjunctiveLicenseSet ;
               spdx:member :LicenseRef-1 , :LicenseRef-4 , :LicenseRef-2 , Apache-1.0 , :LicenseRef-3 , MPL-1.1 , Apache-2.0
             ] ;
     spdx:licenseDeclared
             [ rdf:typeof spdx:ConjunctiveLicenseSet ;
               spdx:member :LicenseRef-1 , :LicenseRef-4 , :LicenseRef-2 , :LicenseRef-3 , MPL-1.1 , Apache-2.0
             ] ;