Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the new extensions model #429

12 of 16 tasks
danbri opened this issue Apr 16, 2015 · 6 comments
12 of 16 tasks

Implement the new extensions model #429

danbri opened this issue Apr 16, 2015 · 6 comments
site tools + python code Infrastructural issues around site. Most can ignore this! type:tricky problem Hard problems, including modeling / vocabulary and infrastructural aspects (eg fiction, probability)


Copy link

danbri commented Apr 16, 2015

Meta bug. See discussion thread

Related: draft bib: extension #431

First cut code was merged from sdo-scripts into sdo-gozer, April 27th.


Site navigation

For any running installation of the site, ... considering a base domain such as '', '', '' etc., here written BASE_DOMAIN:

  • foo.BASE_DOMAIN/Person (since Person is a term defined in the core, and 'foo' is a hypothetical extension) should display as normal, while indicating that we are viewing the 'foo' extension.
  • xyz.BASE_DOMAIN/Person etc. should completely fail, e.g. 404 or browser resolution error, if 'xyz' is not enabled as an extension name on that installation.
  • foo.BASE_DOMAIN/XyzAbc should fail by 404 if XyzAbc is not a known term in any enabled extension running on that installation.
  • BASE_DOMAIN/Globe should fail with a helpful 404, with links to each extension e.g. 'foo' which defines/mentions the term 'Globe' (or any term that is known to an extension enabled in that installation).
  • foo.BASE_DOMAIN/Globe should succeed, rendering a per-term page describing Globe, assuming Globe is a term defined in an extension 'foo' enabled on that installation. Navigation to related terms from core and from within 'foo' by normal means, i.e. Place, Event, CreativeWork, name etc from core would be listed and navigable "within the extension". STATUS: works but needs the ext=bib still.
  • foo.BASE_DOMAIN/ should present a simple homepage for the extension, including a short description of its purpose/scope, and a link to github for development. It should also list all terms defined by the extension, including their (e.g. supertype, subtype) connection to the core. This assumes content-type requested was text/html.
  • foo.BASE_DOMAIN/docs/datamodel.html and other generic documentation should redirect transparently to BASE_DOMAIN/docs/datamodel.html to avoid proliferation of multiple URLs for the same static content.
  • foo.BASE_DOMAIN/docs/xyz where xyz is jsonldcontext.json.txt, jsonldcontext.json, tree.jsonld, or full.html needs more thought. These are dynamically generated from "the" schema. Should we replicate per extension? Perhaps move them to a separate path e.g. /data/ or /versions/current/ ?
  • foo.BASE_DOMAIN/ when content type requested is 'application/ld+json' should be a JSON-LD context file, however exact form needs consideration.
  • HTML class attributes are set in the when we are in an extension mode, although the default style sheet currently does not make great use of this.
  • BASE_DOMAIN/ for e.g. CreativeWork should have some link (under 'more...', or lower in page below core vocab) to foo.BASE_DOMAIN/Xyz if Xyz is a subtype, supertype, subproperty, superproperty of CreativeWork in an enabled extension 'foo' on this installation. STATUS: has 'mentions' under 'more...', although the cross-links use url params currently.

Data loading and internal APIs

As with core, all schemas and examples are deployed as part of site updates; they are not loaded dynamically from the Web. This first extensions implementation only addresses reviewed/hosted extensions (e.g. "") and has no treatment of external extensions, i.e. those on external domains.

  • schema data is read from data/ext/{xyz}/*.rdfa files, loaded schema graphs named as layers 'xyz', 'bib' etc, following the folder names.
  • extension-specific examples should be read from data/ext/{xyz}/*txt files, following the format conventions of core
  • Many functions in now take an optional argument (defaulting to 'core') that lists the layer(s) to be applied.
  • There is a notion of current active extension. The default is no extension, i.e. we view only 'the core'. If we are in xyz.BASE_DOMAIN/ then our current active extension is 'xyz'. Current active extension is set by inspecting actual domain and comparing to BASE_DOMAIN.
  • Although there is internal API support (and debugging via URL parameters, ?ext=foo,bar,abc,...), we do not offer public support for navigating multiple extensions simultaneously. Most users will either be looking at a term in the core, a term defined in the extension, or a core term navigated within an extension.


  • Where BASE_DOMAIN is the installation (using a test domain similar to for clarity)
  • 'bib' is a work-in-progress (test data only currently) reviewed/hosted extension enabled in this installation, and loaded from data/ext/bib/*rdfa
  • 'Globe' is a term defined in the bib: extension (although the actual bib extension may not eventually define it, the term is useful for testing here...)

Test URLs:

  • - core term in core. Expect this to navigate as in classic 'Person' (i.e., including some basic discoverability of links into extensions where extension has terms related to Person. STATUS: crude cross-links under 'more...' .
  • - core term, viewed from bib extension. Expect classic navigation of Person but with a header telling us this is the the bib extension. Top of page should be '' hyperlinked to front page.
  • - core term, bogus extension subdomain. Expect: failure to load in browser.
  • - a term defined in (this version of) bib: extension, and navigated within Bib extension.
  • - front page of bib extension. Expect a short intro with links to all or main terms for the extension.
  • - Looking in the core site for a term from an extension, 'Globe', that is not in the core. a 404 or 404-like page, saying that "Globe" is not in the core but listing links to extensions that define or describe it.
@danbri danbri added type:enhancement site tools + python code Infrastructural issues around site. Most can ignore this! type:tricky problem Hard problems, including modeling / vocabulary and infrastructural aspects (eg fiction, probability) labels Apr 16, 2015
@danbri danbri self-assigned this Apr 16, 2015
@danbri danbri added this to the sdo-gozer release milestone Apr 16, 2015
Copy link

It would be nice to simply use GitHub (and Git clients) Search to easily find same or similar named properties, types, etc. across core and extensions (to help with aligning extensions and core, etc).

Q: I think putting extensions themselves in a separate parent folder in the repository (instead of under /data ) might help even more with filtering mechanisms (path) in GitHub extensions and Git clients that many of us use ? Although symbolic links and aliases can help on the client side, second thought.

Copy link
Contributor Author

danbri commented Apr 28, 2015

Also Richard Wallis noted we had reverted to poor utf8 behaviour w/ schema loading, need to find/fix that report.

Copy link
Contributor Author

danbri commented Apr 29, 2015

In pursuit of the above, I've been wiring in the JINJA2 template engine (#459). The homepage is now composed via script-capable templates from templates/*tpl. The variables exposed to the templates are currently too chaotic and shouldn't be considered a stable API. We can rationalize those naming choices once the thing is in a functioning state.

Copy link

First pass ready for evaluation and comment. 'bib' extension proposal implemented to to view.

Enhancement to rdfa files

New element required for classes and properties to associate them with an extension:
Example from

<div typeof="rdfs:Class" resource="">
    <link property="" href="" />
    <span class="h" property="rdfs:label">bib:Chapter</span>
    <span property="rdfs:comment">One of the sections into which a book is divided. A chapter usually has a section number or a name.</span>
    <span> Subclass of:<a property="rdfs:subClassOf" href="">schema:CreativeWork</a>

Note: The '' definition is only required for new [across all extensions & core] terms. The default is to be partOf hence it is not required in core rdfa files. It is also not required when adding extension specific details to an already defined term - eg. Adding to the range of a property:

<div typeof="rdf:Property" resource="">
    <span class="h" property="rdfs:label">schema:pageEnd</span>
    <span>Domain:<a property="" href="">bib:Chapter</a></span>

Display / Navigation of terms in hosted extensions

Home page

Identifying terms from an extension

See example:

  • Visual clue that a term is defined in an extension -- When in extension display mode terms, that are defined in an extension are displayed with '*' as a suffix.
  • CSS identification of extension defined terms -- A class property indicating the extension type has been added to the for the term to allow future visual identification.
<code property="rdfs:label"><a class="ext-bib" href="/readBy">readBy</a>*</code> 

See example: where abridged property is displayed whereas it is not visible in

Identifying potential properties from extensions when displaying in core

See example:

  • Display Available properties in extensions -- On Type display listed near end of information by Type

Navigation to extension definition

  • Clicking on an, extension defined term when in core will take user to that term in the correct extension.
  • When in extension display mode, clicking on a any term defined in core or the currently displayed extension will take the user to that term whilst remaining in the current extension mode.


  • When in core, display available superclasses defined in extensions.
  • Extension enhancements to full listing of types eg. List only types defined in an extension, or core only, or all types in core and extensions.

@RichardWallis RichardWallis reopened this Jul 27, 2015
RichardWallis pushed a commit that referenced this issue Aug 27, 2015
…org (#727)

Cleaned up navigation after v2.1.
Made navigation through menus and docs consistent as to when to remain in an extension or to force to basic  Included making schemas.html into a template.

Also maintains the http/https state through a user session.
Corrected thread based caching of global variables errors that were introduced with extensions - reset temporary fix of threadsafe=false in app.yaml.

Introduced a /_siteDebug page to monitor cache usage and settings etc.

(#429) - Completing the initial extensions model
(#732) - Docs links for menus now go to base url
(#716) - Preparing ground by at least being in session consistent
Copy link

This can be closed following application of pull (#751)

There will be further enhancements to how user interact with extensions but they should be raised separately.

Copy link
Contributor Author

danbri commented Sep 7, 2015

Yup. We should list new things needing extension-related support in #1 too (including external extensions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
site tools + python code Infrastructural issues around site. Most can ignore this! type:tricky problem Hard problems, including modeling / vocabulary and infrastructural aspects (eg fiction, probability)
None yet

No branches or pull requests

3 participants