Skip to content

rdf-elixir/dcat-ex

Repository files navigation

Hex.pm Hex Docs License

ExUnit Tests Dialyzer Quality Checks

DCAT.ex

An implementation of the W3C Data Catalog Vocabulary (DCAT) - Version 3 vocabulary for Elixir as Grax schemas.

The API documentation can be found here. For more information about the RDF on Elixir projects, go to https://rdf-elixir.dev.

Features

  • The DCAT module acts as the RDF.Vocabulary.Namespace for the DCAT vocabulary
  • Grax structures for all DCAT classes and their properties, for easy creation and manipulation of data catalogs, datasets, and data services
  • Seamless integration with all RDF on Elixir projects

Installation

Add dcat to your list of dependencies in mix.exs:

def deps do
  [
    {:dcat, "~> 0.1"}
  ]
end

Usage

DCAT.Dataset.build!(EX.my_dataset(),
  title: "My Dataset",
  description: "This is a sample dataset",
  release_date: Date.utc_today(),
  publishers: [EX.my_org()],
  keywords: ["sample", "dataset", "example"],
  themes: [EX.sample_theme()]
) 
|> Grax.to_rdf!(prefixes: [dcat: DCAT, ex: EX, xsd: RDF.NS.XSD, dct: DCAT.NS.DCTerms]) 
|> RDF.Turtle.write_string!()

produces:

@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix ex: <http://example.com/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:my_dataset
    a dcat:Dataset ;
    dct:title "My Dataset" ;
    dct:description "This is a sample dataset" ;
    dct:issued "2024-08-06"^^xsd:date ;
    dct:publisher ex:my_org ;
    dcat:keyword "dataset", "example", "sample" ;
    dcat:theme ex:sample_theme .

Contributing

See CONTRIBUTING for details.

Consulting

If you need help with your Elixir and Linked Data projects, just contact NinjaConcept via [email protected].

License and Copyright

(c) 2024 Marcel Otto. MIT Licensed, see LICENSE for details.

About

An implementation of DCAT for Elixir

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages