Skip to content

vcharpenay/schemaorg-clj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Schema.org

Re-writing of schemaorg in Clojure.

Changes:

  • no local triple store, schema units are retrieved via SPARQL HTTP
  • extended generic term page template
  • no extension, all namespaces considered equal
  • one server can serve other namespaces along with the default namespace

TODO:

  • other templates
    • fullReleasePage.tpl
  • redirection to other known namespace (and mark domain/range as unknown if somewhere else)
  • examples
  • 'see also' and 'source' links
  • RDFa annotations (or JSON-LD?)
  • static site generation build command
  • content negotiation
  • unit caching
  • logging
  • reorganizing templates (e.g. put HTML head in a separate file)
  • write templates with hiccup (Clojure DSL for HTML)?
  • unit tests
  • document properties (e.g. sitename, sitebase)

Prerequisites

SPARQL dataset structure

Schema definitions belonging to a given namespace are expected to be put in a named graph whose URI is the same as the namespace URI (without trailing slash).

For instance, one can have

GRAPH <http://schema.org> {
    <http://schema.org/Thing> a rdfs:Class ;
        rdfs:label "Thing" ;
        rdfs:comment "The most generic type of item." .
}

GRAPH <http://core.example.org> {
    <http://core.example.org/Something> a rdfs:Class ;
        rdfs:label "Something" ;
        rdfs:comment "Well... Anything." ;
        rdfs:subClassOf <http://schema.org/Thing> .
}

Running

First, open resources/schemaorg.properties and change sparql_endpoint to point to your own SPARQL endpoint:

sitename=example.org
sitemode=mainsite
sparql_endpoint=http://example.org/someSPARQLEndpoint

Then, to start a web server for the application, run:

lein ring server

License

Copyright © 2017 Victor Charpenay

About

Re-writing of schemaorg in Clojure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published