Skip to content

A generic framework for simplifying the creation of linked data.

Notifications You must be signed in to change notification settings

pldn/LDWizard-old

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 

Repository files navigation

This is an old repo, the new one is over at https://github.com/pldn/LDWizard

LD Wizard: Create Linked Data in One Spell

LD Wizard is a framework for creating end-user focused Graphical User Interfaces (GUIs) that simplify the creation and publication of linked data.

1. LD Wizard Project

The LD Wizard project delivers the following products:

LD Wizard Core
A separate repository where the LD Wizard Core codebase is developed and maintained.
Cultural Heritage Wizard
A specific configuration of the LD Wizard by the Dutch Digital Heritage Network.
UM - Humanities and Social Sciences
A specific configuration of the LD Wizard by the University of Maastricht for transforming tabular data in the humanities and the social sciences.
UM - BioLink
A specific configuration of the LD Wizard by the University of Maastricht for transforming BioLink tables.
GeoData Wizard
A specific application of the LD Wizard configured for linking Dutch geo data to the BAG and BRT.
LD Wizard Design
A detailed design document that consolidates the requirements, limitations and structural components for the LD Wizard approach.

2. Create your own LD Wizard!

You can create your own LD Wizard application by following these steps:

  1. Install Node.js and Yarn.

    On Ubuntu this is done with the following commands. Check the project websites for installation on other operating systems.

    curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    sudo apt update
    sudo apt install nodejs yarn
  2. Create a directory for your application:

    mkdir my-wizard
    cd my-wizard
  3. Add the LD Wizard dependency:

    yarn add @netwerkdigitaalerfgoed/ldwizard
  4. Create a configuration file called config.ts and enter the following content:

    // This is a template file
    import WizardConfig from "@netwerkdigitaalerfgoed/ldwizard/types/WizardConfig";
    const wizardConfig: WizardConfig = {};
    export default wizardConfig;
  5. Run the following command to build your application:

    yarn exec ldwizard-build config.ts

Your LD Wizard application can now be found inside the lib/ directory.

2a. Run locally

You can upload your LD Wizard application to an online location and use it there. But you can also run the application locally by starting an HTTP server. If you do not yet have an HTTP server installed, run the following command:

npm install -g http-server

With this particular HTTP server the LDWizard can be started in the following way:

cd lib
http-server .

Open http://localhost:8080 in a web browser.

2b. Configuration options

You can customize your LD Wizard application by adding the following configuration options to your configuration file (config.ts).

setting type default description
appName string LD Wizard The name of the LD Wizard instance.
icon string The icon that is used inside the application.
favIcon string The icon that is used as the 'favicon'. This icon commonly appears in web browser tabs.
primaryColor string #6d1e70 The primary color that is used in the application.
secondaryColor string #a90362 The secondary color that is used in the application.
homepageMarkdown string undefined Optional name of a Markdown file that acts as the homepage for the LD Wizard application.
defaultBaseIri string https://data.netwerkdigitaalerfgoed.nl/ The default base IRI that is used for linked data transformations.
classConfig {method: "elastic" | "sparql"; endpoint: string;} {method:"sparql"; endpoint: "https://api.data.netwerkdigitaalerfgoed.nl/datasets/ld-wizard/sdo/services/sparql/sparql"} The service that is used for giving class suggestions.
predicateConfig {method: "elastic" | "sparql"; endpoint: string;} {method:"sparql"; endpoint: "https://api.data.netwerkdigitaalerfgoed.nl/datasets/ld-wizard/sdo/services/sparql/sparql"} The service that is used for giving property suggestions.
getAllowedPrefixes () => Promise<{prefixLabel:string; iri:string}[]> () => [] A function that is used to return prefix declarations.
publishOrder ("download" | "triplydb")[] ["download","triplydb"] The order in which publishing options are shown in the 'publish' step. It is also possible to exclude publication options by removing them from this list.
dataplatformLink string https://data.netwerkdigitaalerfgoed.nl Link to the data platform that is used in the footer. This data platform is also used for creating API tokens during the 'publish' step.
documentationLink string https://github.com/netwerk-digitaal-erfgoed/LDWizard Link to the generic LD Wizard project.
repositoryLink string https://github.com/netwerk-digitaal-erfgoed/LDWizard-Core Link to the specific LD Wizard configuration.
newDatasetAccessLevel "public" | "internal" | "private" "private" The access level to use for new datasets

2c. Building your own Docker container

You can create a Docker container for your LD Wizard application by running the following command:

docker build -f ./docker/Dockerfile -t "my-tag" --build-arg CONFIG_FILE=config.ts

3. Explanation of backend services

LD Wizard runs entirely within the web browser, making it a client-side application. In order to give the user sugesstions about their data, LD Wizard sends/reveives requests to/from external linked data services. This section describes some of the external services that can be used by LD Wizard.

3a. Suggestions with SPARQL

When classConfig and/or predicateConfig are set to sparql, LD Wizard uses one or two SPARQL endpoints to retrieve suggestions for classes and properties, respectively. The SPARQL queries that are used can be found in the LD Wizard Core repository.

These queries support class and property descriptions that follow linked data standards and best practices:

3b. Suggestions with ElasticSearch

When classConfig and/or preficateConfig are set to elastic, LD Wizard uses generic ElasticSearch text queries to retrieve suggestions for classes and properties. The ElasticSearch queries that are used can be found in the LD Wizard Core repository.

These queries support class and property descriptions that follow linked data standards and best practices. See Section 3a for details.

In order to create an ElasticSearch service that can be queried in this way, your linked dataset must be indexed as a collection of JSON files. The most standards-compatible way of doing this is to create one JSON-LD file per non-trivial node. A JSON-LD file contains the Concise Bounded Description (CBD) for a particular node. Trivial nodes are nodes that are already included in the CBD (e.g., blank nodes). These trivial nodes should not be indexed separately.

3c. IRI prefix completion

There is not currently a strandard way of exposing IRI prefixes in RDF. However, there is an initiative to potentially add this feature to a future version of SPARQL.

In the meantime, programmers can configure getAllowedPrefixes to anything that returns a list of IRI prefix objects. The following example does this for the TriplyDB backend:

getAllowedPrefixes: async () => {
  const response = await fetch("https://api.data.netwerkdigitaalerfgoed.nl/datasets/ld-wizard/sdo/prefixes");
  if (response.ok) {
    const prefixes: PrefixEntry[] = await response.json();
    return prefixes;
  }
}

4. Attribution

LD Wizard is an initiative of the following organizations and people:

Releases

No releases published

Packages

No packages published