Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thi.ng/prefixes

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/prefixes

50+ Linked Data vocabulary prefixes and their namespace URLs

  • 2.1.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
385
increased by45.83%
Maintainers
1
Weekly downloads
 
Created
Source

prefixes

npm version npm downloads Twitter Follow

This project is part of the @thi.ng/umbrella monorepo.

About

50+ Linked Data vocabulary prefixes and their namespace URLs.

Status

STABLE - used in production

Search or submit any issues for this package

Installation

yarn add @thi.ng/prefixes

ES module import:

<script type="module" src="https://cdn.skypack.dev/@thi.ng/prefixes"></script>

Skypack documentation

For Node.js REPL:

# with flag only for < v16
node --experimental-repl-await

> const prefixes = await import("@thi.ng/prefixes");

Package sizes (gzipped, pre-treeshake): ESM: 1.12 KB

Dependencies

None

API

Generated API docs

This package only contains constants, no actual code. Please see source code for full list provided.

Note: some namespace URIs exist in two flavors - for RDF vocab and as XML namespace. The latter versions are always prefixed with XML_, e.g.:

import { xsd, XML_XSD } from "@thi.ng/prefixes";

xsd     // http://www.w3.org/2001/XMLSchema#
XML_XSD // http://www.w3.org/2001/XMLSchema

Usage with @thi.ng/hiccup

All current @thi.ng/hiccup consumers/processors support RDFa attributes and specifically allow the prefix attrib value to be given as object of prefixes. This allows for very compact prefix definitions like so:

import { serialize } from "@thi.ng/hiccup";
import { article, body, div, h1, html } from "@thi.ng/hiccup-html";
import { dc, schema } from "@thi.ng/prefixes";

serialize(
    html({ lang: "en" },
        body({ prefix: { dc, schema } },
            article({ resource: "/posts/hello-world", typeof: "schema:BlogPosting"},
                h1({ property: "dc:title" }, "Hello World"),
                div({ property: "schema:articleBody" }, "...")
            )
        )
    )
);

Serialized HTML/RDFa result:

<html lang="en">
    <body prefix="dc: http://purl.org/dc/elements/1.1/ schema: http://schema.org/">
        <article resource="/posts/hello-world" typeof="schema:BlogPosting">
            <h1 property="dc:title">Hello World</h1>
            <div property="schema:articleBody">...</div>
        </article>
    </body>
</html>

Authors

Karsten Schmidt

If this project contributes to an academic publication, please cite it as:

@misc{thing-prefixes,
  title = "@thi.ng/prefixes",
  author = "Karsten Schmidt",
  note = "https://thi.ng/prefixes",
  year = 2020
}

License

© 2020 - 2022 Karsten Schmidt // Apache Software License 2.0

Keywords

FAQs

Package last updated on 09 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc