Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/schema_salad-7.1.20210316164414.dist-info/METADATA @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
| author | shellac |
|---|---|
| date | Mon, 22 Mar 2021 18:12:50 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4f3585e2f14b |
|---|---|
| 1 Metadata-Version: 2.1 | |
| 2 Name: schema-salad | |
| 3 Version: 7.1.20210316164414 | |
| 4 Summary: Schema Annotations for Linked Avro Data (SALAD) | |
| 5 Home-page: https://github.com/common-workflow-language/schema_salad | |
| 6 Author: Common workflow language working group | |
| 7 Author-email: common-workflow-language@googlegroups.com | |
| 8 License: Apache 2.0 | |
| 9 Download-URL: https://github.com/common-workflow-language/schema_salad/releases | |
| 10 Platform: UNKNOWN | |
| 11 Classifier: Environment :: Console | |
| 12 Classifier: Intended Audience :: Science/Research | |
| 13 Classifier: License :: OSI Approved :: Apache Software License | |
| 14 Classifier: Operating System :: POSIX | |
| 15 Classifier: Operating System :: MacOS :: MacOS X | |
| 16 Classifier: Operating System :: Microsoft :: Windows | |
| 17 Classifier: Development Status :: 5 - Production/Stable | |
| 18 Classifier: Programming Language :: Python :: 3.6 | |
| 19 Classifier: Programming Language :: Python :: 3.7 | |
| 20 Classifier: Programming Language :: Python :: 3.8 | |
| 21 Classifier: Programming Language :: Python :: 3.9 | |
| 22 Classifier: Typing :: Typed | |
| 23 Requires-Python: >=3.6 | |
| 24 Description-Content-Type: text/x-rst | |
| 25 Requires-Dist: setuptools | |
| 26 Requires-Dist: requests (>=1.0) | |
| 27 Requires-Dist: ruamel.yaml (<=0.16.5,>=0.12.4) | |
| 28 Requires-Dist: rdflib (<=5.0.0,>=4.2.2) | |
| 29 Requires-Dist: rdflib-jsonld (<0.6.0,>=0.3.0) | |
| 30 Requires-Dist: mistune (<0.9,>=0.8.1) | |
| 31 Requires-Dist: CacheControl (<0.12,>=0.11.7) | |
| 32 Requires-Dist: lockfile (>=0.9) | |
| 33 Requires-Dist: typing-extensions | |
| 34 Provides-Extra: docs | |
| 35 Requires-Dist: sphinx (>=2.2) ; extra == 'docs' | |
| 36 Requires-Dist: sphinx-rtd-theme ; extra == 'docs' | |
| 37 Requires-Dist: pytest (<7) ; extra == 'docs' | |
| 38 | |
| 39 |Linux Build Status| |Windows Build status| |Code coverage| |CII Best Practices| | |
| 40 | |
| 41 .. |Linux Build Status| image:: https://github.com/common-workflow-language/schema-salad/actions/workflows/ci-tests.yml/badge.svg?branch=main | |
| 42 :target: https://github.com/common-workflow-language/schema-salad/actions/workflows/ci-tests.yml | |
| 43 .. |Windows Build status| image:: https://img.shields.io/appveyor/ci/mr-c/schema-salad/main.svg?label=windows%20build | |
| 44 :target: https://ci.appveyor.com/project/mr-c/schema-salad/branch/main | |
| 45 .. |Code coverage| image:: https://codecov.io/gh/common-workflow-language/schema_salad/branch/main/graph/badge.svg | |
| 46 :target: https://codecov.io/gh/common-workflow-language/schema_salad | |
| 47 .. |CII Best Practices| image:: https://bestpractices.coreinfrastructure.org/projects/1867/badge | |
| 48 :target: https://bestpractices.coreinfrastructure.org/projects/1867 | |
| 49 | |
| 50 Schema Salad | |
| 51 ------------ | |
| 52 | |
| 53 Salad is a schema language for describing JSON or YAML structured | |
| 54 linked data documents. Salad schema describes rules for | |
| 55 preprocessing, structural validation, and hyperlink checking for | |
| 56 documents described by a Salad schema. Salad supports rich data | |
| 57 modeling with inheritance, template specialization, object | |
| 58 identifiers, object references, documentation generation, code | |
| 59 generation, and transformation to RDF_. Salad provides a bridge | |
| 60 between document and record oriented data modeling and the Semantic | |
| 61 Web. | |
| 62 | |
| 63 The Schema Salad library is Python 3.6+ only. | |
| 64 | |
| 65 Usage | |
| 66 ----- | |
| 67 | |
| 68 :: | |
| 69 | |
| 70 $ pip install schema_salad | |
| 71 | |
| 72 To install from source:: | |
| 73 | |
| 74 git clone https://github.com/common-workflow-language/schema_salad | |
| 75 cd schema_salad | |
| 76 python3 setup.py install | |
| 77 | |
| 78 Commands | |
| 79 -------- | |
| 80 | |
| 81 Schema salad can be used as a command line tool or imported as a Python module:: | |
| 82 | |
| 83 $ schema-salad-tool | |
| 84 usage: schema-salad-tool [-h] [--rdf-serializer RDF_SERIALIZER] | |
| 85 [--print-jsonld-context | --print-rdfs | --print-avro | |
| 86 | --print-rdf | --print-pre | --print-index | |
| 87 | --print-metadata | --print-inheritance-dot | |
| 88 | --print-fieldrefs-dot | --codegen language | |
| 89 | --print-oneline] | |
| 90 [--strict | --non-strict] [--verbose | --quiet | |
| 91 | --debug] | |
| 92 [--version] | |
| 93 [schema] [document] | |
| 94 | |
| 95 $ python | |
| 96 >>> import schema_salad | |
| 97 | |
| 98 Validate a schema:: | |
| 99 | |
| 100 $ schema-salad-tool myschema.yml | |
| 101 | |
| 102 Validate a document using a schema:: | |
| 103 | |
| 104 $ schema-salad-tool myschema.yml mydocument.yml | |
| 105 | |
| 106 Generate HTML documentation:: | |
| 107 | |
| 108 $ schema-salad-tool myschema.yml > myschema.html | |
| 109 | |
| 110 Get JSON-LD context:: | |
| 111 | |
| 112 $ schema-salad-tool --print-jsonld-context myschema.yml mydocument.yml | |
| 113 | |
| 114 Convert a document to JSON-LD:: | |
| 115 | |
| 116 $ schema-salad-tool --print-pre myschema.yml mydocument.yml > mydocument.jsonld | |
| 117 | |
| 118 Generate Python classes for loading/generating documents described by the schema:: | |
| 119 | |
| 120 $ schema-salad-tool --codegen=python myschema.yml > myschema.py | |
| 121 | |
| 122 Display inheritance relationship between classes as a graphviz 'dot' file and | |
| 123 render as SVG:: | |
| 124 | |
| 125 $ schema-salad-tool --print-inheritance-dot myschema.yml | dot -Tsvg > myschema.svg | |
| 126 | |
| 127 | |
| 128 Quick Start | |
| 129 ----------- | |
| 130 | |
| 131 Let's say you have a 'basket' record that can contain items measured either by | |
| 132 weight or by count. Here's an example:: | |
| 133 | |
| 134 basket: | |
| 135 - product: bananas | |
| 136 price: 0.39 | |
| 137 per: pound | |
| 138 weight: 1 | |
| 139 - product: cucumbers | |
| 140 price: 0.79 | |
| 141 per: item | |
| 142 count: 3 | |
| 143 | |
| 144 We want to validate that all the expected fields are present, the | |
| 145 measurement is known, and that "count" cannot be a fractional value. | |
| 146 Here is an example schema to do that:: | |
| 147 | |
| 148 - name: Product | |
| 149 doc: | | |
| 150 The base type for a product. This is an abstract type, so it | |
| 151 can't be used directly, but can be used to define other types. | |
| 152 type: record | |
| 153 abstract: true | |
| 154 fields: | |
| 155 product: string | |
| 156 price: float | |
| 157 | |
| 158 - name: ByWeight | |
| 159 doc: | | |
| 160 A product, sold by weight. Products may be sold by pound or by | |
| 161 kilogram. Weights may be fractional. | |
| 162 type: record | |
| 163 extends: Product | |
| 164 fields: | |
| 165 per: | |
| 166 type: | |
| 167 type: enum | |
| 168 symbols: | |
| 169 - pound | |
| 170 - kilogram | |
| 171 jsonldPredicate: '#per' | |
| 172 weight: float | |
| 173 | |
| 174 - name: ByCount | |
| 175 doc: | | |
| 176 A product, sold by count. The count must be a integer value. | |
| 177 type: record | |
| 178 extends: Product | |
| 179 fields: | |
| 180 per: | |
| 181 type: | |
| 182 type: enum | |
| 183 symbols: | |
| 184 - item | |
| 185 jsonldPredicate: '#per' | |
| 186 count: int | |
| 187 | |
| 188 - name: Basket | |
| 189 doc: | | |
| 190 A basket of products. The 'documentRoot' field indicates it is a | |
| 191 valid starting point for a document. The 'basket' field will | |
| 192 validate subtypes of 'Product' (ByWeight and ByCount). | |
| 193 type: record | |
| 194 documentRoot: true | |
| 195 fields: | |
| 196 basket: | |
| 197 type: | |
| 198 type: array | |
| 199 items: Product | |
| 200 | |
| 201 You can check the schema and document in schema_salad/tests/basket_schema.yml | |
| 202 and schema_salad/tests/basket.yml:: | |
| 203 | |
| 204 $ schema-salad-tool basket_schema.yml basket.yml | |
| 205 Document `basket.yml` is valid | |
| 206 | |
| 207 | |
| 208 Documentation | |
| 209 ------------- | |
| 210 | |
| 211 See the specification_ and the metaschema_ (salad schema for itself). For an | |
| 212 example application of Schema Salad see the Common Workflow Language_. | |
| 213 | |
| 214 | |
| 215 Rationale | |
| 216 --------- | |
| 217 | |
| 218 The JSON data model is an popular way to represent structured data. It is | |
| 219 attractive because of it's relative simplicity and is a natural fit with the | |
| 220 standard types of many programming languages. However, this simplicity comes | |
| 221 at the cost that basic JSON lacks expressive features useful for working with | |
| 222 complex data structures and document formats, such as schemas, object | |
| 223 references, and namespaces. | |
| 224 | |
| 225 JSON-LD is a W3C standard providing a way to describe how to interpret a JSON | |
| 226 document as Linked Data by means of a "context". JSON-LD provides a powerful | |
| 227 solution for representing object references and namespaces in JSON based on | |
| 228 standard web URIs, but is not itself a schema language. Without a schema | |
| 229 providing a well defined structure, it is difficult to process an arbitrary | |
| 230 JSON-LD document as idiomatic JSON because there are many ways to express the | |
| 231 same data that are logically equivalent but structurally distinct. | |
| 232 | |
| 233 Several schema languages exist for describing and validating JSON data, such as | |
| 234 JSON Schema and Apache Avro data serialization system, however none | |
| 235 understand linked data. As a result, to fully take advantage of JSON-LD to | |
| 236 build the next generation of linked data applications, one must maintain | |
| 237 separate JSON schema, JSON-LD context, RDF schema, and human documentation, | |
| 238 despite significant overlap of content and obvious need for these documents to | |
| 239 stay synchronized. | |
| 240 | |
| 241 Schema Salad is designed to address this gap. It provides a schema language | |
| 242 and processing rules for describing structured JSON content permitting URI | |
| 243 resolution and strict document validation. The schema language supports linked | |
| 244 data through annotations that describe the linked data interpretation of the | |
| 245 content, enables generation of JSON-LD context and RDF schema, and production | |
| 246 of RDF triples by applying the JSON-LD context. The schema language also | |
| 247 provides for robust support of inline documentation. | |
| 248 | |
| 249 .. _JSON-LD: http://json-ld.org | |
| 250 .. _Avro: http://avro.apache.org | |
| 251 .. _metaschema: https://github.com/common-workflow-language/schema_salad/blob/main/schema_salad/metaschema/metaschema.yml | |
| 252 .. _specification: http://www.commonwl.org/v1.0/SchemaSalad.html | |
| 253 .. _Language: https://github.com/common-workflow-language/common-workflow-language/blob/main/v1.0/CommandLineTool.yml | |
| 254 .. _RDF: https://www.w3.org/RDF/ | |
| 255 | |
| 256 |
