Skip to content
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

Package manager #10

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Package manager #10

wants to merge 1 commit into from

Conversation

timothee-haudebourg
Copy link
Collaborator

@timothee-haudebourg timothee-haudebourg commented Mar 21, 2022

The current treeldr executable is just a simple compiler that takes a bunch of RDF input files (in different languages, including TreeLDR) and produces an output in a given format. It is expected that this command line interface will be mostly inconvenient to use when managing dependencies and different targets, with all the associated options. For this reason, this PR proposes to rename the treeldr executable into tldrc (for TreeLDR Compiler) and create a new user friendly "package manager" that handle all of that for us. This draft presents some of the possible features for such "package manager".

Configuration file

A treeldr.toml file (or, yaml, or any other configuration file format) defines, at the root, the dependencies and build targets of the package, with some metadata. Here is how it could look like:

[package]
base = "https://example.com"
version = "0.1.0"

[dependencies]
"https://schema.org" = "14.0"

# Generate a JSON-LD context.
[json-ld-context]
target = "context.jsonld"

# Generate a typescript package.
[typescript]
# Will generate `package.json`, `tsconfig.json`, `src/`, ...

TreeLDR Package

A package is primarily defined by a base IRI and an RDF dataset defining
new terms relative to this base IRI.
For every RDF quad in the dataset:

  • Either the subject, predicate or object must be relative to the base IRI.
  • The graph must be relative to the base IRI.

Other quads are not allowed in the package.
The registry should prevent the definition of forbidden quads upon publishing.

Versioning

A package is published on a registry with a version strictly following
Semantic Versioning 2.0.0.

A change in the dataset is considered backward compatible if and only if:

  • No quad are removed; and
  • The predicate of a newly added quad is not
    http://www.w3.org/1999/02/22-rdf-syntax-ns#type
  • The predicate is not a property taking at most one value
    (declared for instance with https://schema.org/multipleValues).

Duplicates are ignored. Implicit quads (derived from the semantics of a term)
are not ignored.
For instance, for every property p, the following implicit quad is always
defined:

p <https://schema.org/multipleValues> <https://schema.org/False>

unless the following quad is explicitly defined:

p <https://schema.org/multipleValues> <https://schema.org/True>

Adding the later would be a breaking change, as it implicitly means removing the
former.

Registry

Packages are downloaded from a registry, or directly from the source for well known packages such as https://schema.org. The registry can be local or remote. Once fetched, packages are cached in the package workspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant