• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 13 years ago
  • Updated almost 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A node.js library that retrieves, parses and provides all schemas from schema.org

node-schema-org

A node.js library that retrieves, parses and provides all schemas from schema.org

Installation

Installing npm (node package manager)

  curl http://npmjs.org/install.sh | sh

Installing node-schema-org

  [sudo] npm install schema-org

Motivation

Although there is some debate from the W3C et al right now, when I came across schema.org I thought: "wow, what a gold mine of potential data formats to use in my applications." Then I looked at the site and thought: "Y U NO GIVE ME JSON FORMAT!?!?!" So I wrote this. It uses some other awesome node.js libraries:

  • jsdom: CommonJS implementation of the DOM intended to be platform independent and as minimal/light as possible while completely adhering to the w3c DOM specifications.
  • neuron: The simplest possible event driven job manager, FIFO queue, and "task based cache" in node.js
  • optimist: Light-weight option parsing for node.js
  • request: Simplified HTTP request client.
  • winston: A multi-transport async logging library for node.js

Usage

Right now, node-schema-org is implemented as a bin script which can be run after you install this module:

  $ read-schema-org

Here is a sample of the output (all of the pre-parsed schemas are available here):

  warn:   Removing all schemas in /path/to/node-schema-org/schemas
  info:   Spawning: node /path/to/node-schema-org/list-schemas.js
  info:   Contacting: http://schema.org/docs/full.html
  info:   Parsing: http://schema.org/docs/full.html
  info:   Reading: http://schema.org/docs/full.html
  info:   Saving results to: /path/to/node-schema-org/schemas/schema-list.json
  info:   Done creating /path/to/node-schema-org/schemas/schema-list.json from http://schema.org/docs/full.html
  info:   node /path/to/node-schema-org/list-schemas.js has exited.
  info:   Spawning: node /path/to/node-schema-org/read-schema.js --type DataType
  info:   Spawning: node /path/to/node-schema-org/read-schema.js --type Boolean
  info:   Spawning: node /path/to/node-schema-org/read-schema.js --type Date
  (....)
  info:   Parsing Type: Place
  info:   Parsing Type: Organization
  info:   Parsing Type: LocalBusiness
  info:   Writing schema: /path/to/node-schema-org/schemas/localbusiness.json
  info:   Done parsing schema: /path/to/node-schema-org/schemas/localbusiness.json
  info:   node /path/to/node-schema-org/read-schema.js --type LocalBusiness has exited.
  info:   
  info:   Done parsing all schemas from schema.org
  info:   They are located in: /path/to/node-schema-org/schemas
  info:   

Sample Schema

  {
    "type": "Place",
    "bases": {
      "Thing": [
        {
          "name": "description",
          "description": "A short description of the item.",
          "type": "Text"
        },
        {
          "name": "image",
          "description": "URL of an image of the item.",
          "type": "URL"
        },
        {
          "name": "name",
          "description": "The name of the item.",
          "type": "Text"
        },
        {
          "name": "url",
          "description": "URL of the item.",
          "type": "Text"
        }
      ]
    },
    "properties": [
      {
        "name": "address",
        "description": "Physical address of the item.",
        "type": "PostalAddress"
      },
      {
        "name": "aggregateRating",
        "description": "The overall rating, based on a collection of reviews or ratings, of the item.",
        "type": "AggregateRating"
      },
      {
        "name": "containedIn",
        "description": "The basic containment relation between places.",
        "type": "Place"
      },
      {
        "name": "events",
        "description": "The events held at this place or organization.",
        "type": "Event"
      },
      {
        "name": "faxNumber",
        "description": "The fax number.",
        "type": "Text"
      },
      {
        "name": "geo",
        "description": "The geo coordinates of the place.",
        "type": "GeoCoordinates"
      },
      {
        "name": "interactionCount",
        "description": "A count of a specific user interactions with this itemโ€”for example, 20 UserLikes, 5 UserComments, or 300 UserDownloads. The user interaction type should be one of the sub types of UserInteraction.",
        "type": "Text"
      },
      {
        "name": "maps",
        "description": "A URL to a map of the place.",
        "type": "Text"
      },
      {
        "name": "photos",
        "description": "Photographs of this place.",
        "type": [
          "Photograph",
          "ImageObject"
        ]
      },
      {
        "name": "reviews",
        "description": "Review of the item.",
        "type": "Review"
      },
      {
        "name": "telephone",
        "description": "The telephone number.",
        "type": "Text"
      }
    ]
  }

Author: Charlie Robbins

License: MIT

More Repositories

1

nconf

Hierarchical node.js configuration with files, environment variables, command-line arguments, and atomic object merging.
JavaScript
3,866
star
2

broadway

Lightweight App extensibility and hookable middleware customization.
JavaScript
250
star
3

node-pkginfo

An easy way to expose properties on a module from a package.json
JavaScript
160
star
4

ps-tree

JavaScript
148
star
5

nodejs-intro

My introduction presentation to node.js along with sample code at various stages of building a simple RESTful web service with director, cradle, winston, optimist, and http-console.
JavaScript
128
star
6

http-agent

A simple agent for performing a sequence of http requests in node.js
JavaScript
92
star
7

errs

Simple error creation and passing utilities
JavaScript
74
star
8

roadmap

A simple CLI script to generate a formatted Roadmap from Github issues and milestones
JavaScript
55
star
9

node-asana-api

A node.js client implementation for Asana API.
JavaScript
41
star
10

fashion-show

Build consistent and versioned styleguides by including and running consistent lint files across projects.
JavaScript
26
star
11

nconf-redis

A redis store for nconf
JavaScript
26
star
12

populist-style

A (one day) auto-updating style at the mercy of the people, and only the people.
JavaScript
22
star
13

presentations

Various presentations that I have made over the span of my time on this pale blue dot.
JavaScript
20
star
14

window-stream

A collection of streams for Windowing events
JavaScript
18
star
15

uuid-time

Get time from RFC4122 uuids
JavaScript
13
star
16

license-tree

Read a tree of files and check for licenses.
JavaScript
12
star
17

dotfiles

Seemed like the thing do to. My dotfiles.
Shell
12
star
18

morgan-json

A variant of `morgan.compile` that provides format functions that output JSON
JavaScript
12
star
19

node-procfile

Procfile parser for node.js
JavaScript
10
star
20

month-ends

Purposefully simple and dependency free functions for calendar months
JavaScript
10
star
21

twitter-no-backend

A simple example of how to use Twitter without any backend.
CSS
10
star
22

picasso

Feather weight CLI tool for synching Github issue labels across repos.
JavaScript
10
star
23

changes

A consistent, fault tolerant CouchDB _changes listener with pre-fetch support
JavaScript
9
star
24

npm-static-stats

Comprehensive static analysis for npm packages through esprima
JavaScript
8
star
25

npm-pipeline

Analysis pipeline for npm packages
JavaScript
8
star
26

xlsx-rows

Parses an *.xlsx file into rows
JavaScript
8
star
27

wpf-window-chrome

A set of controls for using custom window chrome in WPF
C#
7
star
28

node-checkout

Pull down local or remote repositories to local directories.
JavaScript
7
star
29

git-semver2-tag

Upgrades any semver 1.0 tags to semver 2.0. e.g. "v1.0.0" becomes "1.0.0"
JavaScript
6
star
30

exceptiony

A simple remote logging service written in node.js
JavaScript
6
star
31

baltar

A few small utilities for working with tarballs and http.
JavaScript
6
star
32

celluloid

Celluloid is a reactive, input-output oriented language with support for blocks and timelines designed to make both simple and complex media composition operations more comprehensible to the author.
Java
6
star
33

footage

Get your Open Source game footage up to speed.
JavaScript
5
star
34

conver

Comparisons for concrete semantic versions (i.e. compare 1.2.3 instead of ^1.2.3)
JavaScript
5
star
35

git-lint

Lint gitconfig files for fun and profit
JavaScript
5
star
36

node-objs

A complete set of utilities for working with Objects.
JavaScript
5
star
37

fgnpmr

For those special times when replicating npm just won't cut it
JavaScript
4
star
38

npm-publish-split-stream

Splits an npm publish request using jsonstream and duplexify
JavaScript
4
star
39

postcss-global-scss-vars

Inject global variables into your scss using postcss
JavaScript
4
star
40

npm-verify-stream

A duplex stream for receiving a package tarball, verifying arbitrary checks, and emitting that same tarball on success.
JavaScript
4
star
41

hungry-birds

CLI tool for dumping various twitter API results to JSON file(s).
JavaScript
4
star
42

node-artsy

A Node.js client for the Artsy API
JavaScript
3
star
43

npmcount

Silly program that counts number of npm packages from one or more users.
JavaScript
3
star
44

vbump

A very simple version bumping script I've been using for years.
Shell
3
star
45

d3.hexhex

Make a hexagon out of other hexagons in d3
JavaScript
3
star
46

quasar

A Silverlight Control Library
C#
3
star
47

postcss-strip-font-face

PostCSS plugin to completely strip @font-face rules from css. In other words: koh the @font-faceย stealer.
JavaScript
3
star
48

bruce-wayne

A collection of projects and samples written as Bruce Wayne (read: .NET Developer)
C#
3
star
49

dotnet-tools

A set of macros, snippets, and other files that can be really useful for .NET development
Visual Basic
3
star
50

prism-insertable-regions

Extends Prism v2 to allow IRegion to support the Insert operation
C#
2
star
51

designer-mvvm-toolkit

A small set of Model-View-ViewModel tools for implementing Designer Friendly MVVM applications in WPF and Silverlight
C#
2
star
52

npm-codependencies

Calculate codependency relationships for npm modules.
JavaScript
2
star
53

isla.js

A Javascript runtime environment for the Isla language
JavaScript
2
star
54

tar-buffer

Buffers entries from a tar.Parse() stream into memory
JavaScript
2
star
55

npm-comp-stat-www

A set of statistical visualizations for npm packages
JavaScript
2
star
56

zoho-inventory

Fetch-based API client for the Zoho Inventory API
JavaScript
2
star
57

nerf-gun

A tiny utility that returns nerf darts from URLs for npm.
JavaScript
2
star
58

jsonm

A complete json parser written using MGrammar and C#
C#
2
star
59

es6wtf

It's like wtfjs, but for ES6 only
2
star
60

wildcodes

My solutions to http://www.trywildcard.com/challenge
JavaScript
2
star
61

read-ssl

A simple node library to read SSL certificate files according to a basic convention.
JavaScript
2
star
62

surface-raw-input

A collection of behaviors for capturing and working with raw input on the Microsoft Surface
C#
2
star
63

homebase-parser

Parser & file reader for the ABE Homebase 2.0 text (*.txt) format.
JavaScript
1
star
64

gifs

They move. They're funny. They're protected under DMCA.
1
star
65

radiant-scribbish-theme

A port of the scribbish theme to RadiantCMS
JavaScript
1
star
66

ux-logging-toolkit

A toolkit of WPF behaviors and services for logging UX events in a sessions aware manner.
C#
1
star
67

js-lint-compat

Comparison of options for various linting tools. Currently eshint, jshint, and jscs.
1
star
68

npm-package-buffer

Buffers entries from a tar.Parse() stream for an npm package into memory
JavaScript
1
star
69

npmignore-tests

Tells you what modules in `node_modules` npmignore tests
JavaScript
1
star
70

voicebox-www

A bump UI for VoiceBox karaoke
CSS
1
star
71

node-clf-parser

A basic parser for the common log format seen in apache and nginx logs
JavaScript
1
star
72

shared-mocha-suite

An interface to define shareable, configurable mocha tests for use in multiple mocha executions
1
star
73

tap-flattener

Flattens tap output including subtests into a single level hierarchy
JavaScript
1
star