6.2.2 • Published 16 days ago

schema-org-adapter v6.2.2

Weekly downloads
167
License
Apache-2.0
Repository
github
Last release
16 days ago

Features

Empowers the semantic web: Schema.org has become the standard vocabulary for the semantic web. The Schema.org Adapter (SDO-Adapter) gives developers a clear API to access the schema.org vocabulary in a simple way.

Clear data model: The data model of the rdf-based, machine-readable version of Schema.org is slightly adapted (see algorithm documentation for details) to create the clear and pragmatic data model for the Schema.org Adapter.

Supports schema.org versions and external vocabularies: The Schema.org Adapter is lightweight because it does NOT include the vocabulary data, instead it allows the user to input his needed local/remote vocabularies (JSON-LD or URL to JSON-LD). This gives users the possibility to specify the version of Schema.org (including http/https variations) they need, also to use external vocabularies.

Built-in reasoning: The simple-to-use API of this library offers functions and parameters that enable built-in reasoning on the used vocabulary-terms (e.g. resolution of properties, subclasses, ranges, etc.)

Install and load

Independent of the installation and loading method it is expected that a variable named SOA provides this library.

NPM

npm install schema-org-adapter

Node.js

Require/import the package:

const { SOA } = require('schema-org-adapter');
// or
import { SOA } from 'schema-org-adapter';

Browser

Script-include the bundled package in /dist:

<script src="/dist/schema-org-adapter.min.js"></script>
<!--Global variable 'SOA' is available-->

CDN

For the browser you can also directly load the library via CDN:

<script src="https://cdn.jsdelivr.net/gh/semantifyit/schema-org-adapter/dist/schema-org-adapter.min.js"></script>
<!--Global variable 'SOA' is available-->

Usage

// 1. Create an SDO-Adapter instance with the latest schema.org vocabulary version
const mySdoAdapter = await SOA.create({
  schemaVersion: "latest"
});

// 2. Use the SDO-Adapter!

// get all properties that are usable by the class schema:Hotel
const hotelInstance = mySdoAdapter.getClass('schema:Hotel');
const hotelProperties = hotelInstance.getProperties();
// ["schema:audience", "schema:checkinTime", "schema:availableLanguage", ...]

// get all data-types and classes that are valid ranges for the property schema:address
const addressInstance = mySdoAdapter.getProperty("schema:address");
const addressRanges = addressInstance.getRanges();
// ["schema:PostalAddress", "schema:Text"]

Documentation

Technical API documentation

Data Model of the Schema.org Adapter

Expected Vocabulary Structure

Conversion Algorithm for Vocabularies

Code Examples

Example for Node

Example for Browser

All examples

Changelog

History.md

Migration Guide to v6.0.0

6.2.2

16 days ago

6.2.1

18 days ago

6.2.0

19 days ago

6.1.2

26 days ago

6.1.0

1 month ago

6.1.1

1 month ago

6.0.1

4 months ago

6.0.0

4 months ago

5.4.2

1 year ago

5.4.1

1 year ago

5.4.0

1 year ago

5.3.1

1 year ago

5.3.0

1 year ago

5.2.0

2 years ago

5.1.1

2 years ago

5.1.0

2 years ago

5.0.4

2 years ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.3.0

3 years ago

4.2.0

3 years ago

4.1.0

3 years ago

4.0.0

3 years ago

3.5.0

3 years ago

3.4.0

3 years ago

3.3.0

3 years ago

3.2.0

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago