GS1 Logo

GS1 Web Vocabulary | Developer Handover Guide

Authoritative Architecture, Data Model, SSR & Client-Side Hydration Manual

๐ŸŒ Live Tool โ†— ๐Ÿ“– User Guide โ†— โšก Quick Ref
Section 0

Developer Quick-Reference & Cheat Sheet Card

Instant terminal commands, API one-liners, regex validation patterns, and operational shortcuts for onboarding maintainers.

โšก High-Frequency Operational Commands

Operation CLI Command / Script Snippet Target & Output
Local Testing php -S localhost:8080 Starts PHP built-in server with full SSR and clean URLs
Retrieve Turtle via Conneg curl -i -H "Accept: text/turtle" https://ref.gs1.org/voc/Product Returns serialized Turtle with Content-Type text/turtle
Retrieve JSON-LD via Conneg curl -i -H "Accept: application/ld+json" https://ref.gs1.org/voc/Product Returns compacted JSON-LD entity with @context
Retrieve Markdown via Conneg curl -i -H "Accept: text/markdown" https://ref.gs1.org/voc/Product Returns GitHub Flavored Markdown with Content-Type text/markdown; charset=utf-8; variant=GFM (RFC 7763). Also available as /voc/Product.md and ?format=md
Whole vocabulary as Markdown curl -i -H "Accept: text/markdown" https://ref.gs1.org/voc/ Returns an index of all classes, properties, link types and code lists, with the list of published versions
Historic version curl -i "https://ref.gs1.org/voc/Product?format=md&version=1.17.0" Answers from a published earlier version. Works for the whole vocabulary and for single terms, in Markdown, JSON-LD and Turtle
Query Parameter Turtle curl -i "https://ref.gs1.org/voc/Product?format=turtle" Forces text/turtle response regardless of Accept header (aliases: text/turtle, ttl)
Query Parameter JSON-LD curl -i "https://ref.gs1.org/voc/Product?format=application/ld+json" Forces JSON-LD response via query parameter override (normalizing + trap; aliases: jsonld)
Full Ontology Export curl -s -H "Accept: text/turtle" https://ref.gs1.org/voc/ Streams complete canonical gs1Voc.ttl graph
Validate PHP Syntax php -l index.php && php -l OntologyRepository.php Zero syntax errors check across PHP runtime files
Validate JS Syntax for f in js/*.js js/components/*.js; do node -c "$f"; done Zero syntax errors check across ES module frontend
๐Ÿงช Open Live Conneg Playground ๐Ÿ“ฆ Inspect Data Artifacts โ–ถ Run Test Vectors ๐Ÿ“š Codebase Method Index ๐Ÿ›  Troubleshooting Matrix ๐Ÿ“– Open User Guide โ†—
Section 1

Technical Purpose & Standards Enforced

The GS1 Web Vocabulary tool hosted at https://ref.gs1.org/voc/ is the canonical public reference implementation and Linked Open Data (LOD) server for GS1 master data semantics. It allows web crawlers, search engines (Google, Bing, Yandex), semantic web agents, ERP systems, and web developers to dereference any GS1 term (e.g. gs1:Product, gs1:gtin, gs1:address) directly over HTTP.

Normative Standards & Specification Clauses

Standard Document Release / Edition Governing Clause Technical Requirement Enforced
GS1 Web Vocabulary Standard Release 1.18.0 (2026) Section 3 & 4 Canonical JSON-LD ontology defining GS1 classes, properties, domains, ranges, and controlled code lists.
GS1 General Specifications Release 26.0 (Jan 2026) Section 3 & Section 7 AI data architecture, GTIN semantics, GLN location attributes, and identification keys.
GS1 Digital Link Standard Release 1.2 Section 4.3 & 5 URI syntax, link types (gs1:linkType), and HTTP content negotiation semantics.
W3C JSON-LD 1.1 W3C Recommendation Section 4 & 8 Context parsing, URI expansion, blank node identifiers (_:u1), and @graph schemas.
W3C Turtle (Terse RDF Triple Language) W3C Recommendation Section 2 & 6 Prefix headers (@prefix gs1: <https://ref.gs1.org/voc/> .), predicate-object list serializations.
Schema.org Extension Mechanism schema.org Current domainIncludes & rangeIncludes Multi-domain and multi-range associations avoiding strict formal OWL union blank node bottlenecks.
RFC 9110 (HTTP Semantics) IETF Standard Section 12.5.1 Accept header quality values (q-factor) negotiation, Vary: Accept, Accept-Encoding.

Authoritative URI Namespace Mandate

The canonical namespace URI for all vocabulary terms is https://ref.gs1.org/voc/. In Turtle serializations, the standard prefix is @prefix gs1: <https://ref.gs1.org/voc/> .. Dereferencing https://ref.gs1.org/voc/{term} MUST yield either the HTML term view or the serialized RDF entity matching the requester's Accept header.

Section 2

Tech Stack, Dependency Bill of Materials & Data Artifacts

The tool is engineered under a zero-build, offline-first Progressive Web App (PWA) architecture targeted for deployment on standard Apache 2.4+ / PHP 8.1+ web servers. There are strictly zero Node.js server runtimes, zero npm build steps, and zero external CDN runtime dependencies.

Bill of Materials (BOM)

Component / Library Version File Location Architectural Purpose & Rationale
PHP Runtime 8.1+ (Strict Types) index.php, OntologyRepository.php Server-side pre-rendering (SSR), content negotiation, cache generation, Turtle serialization.
Vue.js (Global Build) 3.4.x (Options API) js/vendor/vue.global.min.js Client-side progressive hydration, interactive search, state management. Zero build step.
Apache Web Server 2.4+ .htaccess, data/.htaccess Clean URL rewriting, content-negotiated routing for Turtle/JSON-LD, CORS header injection.
Vanilla CSS CSS3 (Handwritten) css/style.css Semantic styling, property diagrams, high-contrast tables, responsive layout.
Canonical GS1 Styles GS1 Base v1 https://ref.gs1.org/styles/base.css Standard GS1 branding, typography, header, and footer styles.

Annotated Directory Tree Layout

/                                   # project root
โ”œโ”€โ”€ .htaccess                       # Apache routing: conneg redirects & clean URLs (27 lines)
โ”œโ”€โ”€ index.php                       # Dual-mode SSR bootstrapper & SPA HTML entry point (870 lines)
โ”œโ”€โ”€ OntologyRepository.php          # Core ontology parser, 2-pass indexer & Turtle serializer (699 lines)
โ”œโ”€โ”€ developer-guide.html            # Single-file Developer Handover PWA (this document)
โ”œโ”€โ”€ css/
โ”‚   โ””โ”€โ”€ style.css                   # Custom GS1 WebVoc layout & property diagram styles (132 lines)
โ”œโ”€โ”€ js/
โ”‚   โ”œโ”€โ”€ createApp.js                # Root Vue 3 application, reactive computed properties & routing (928 lines)
โ”‚   โ”œโ”€โ”€ vendor/
โ”‚   โ”‚   โ””โ”€โ”€ vue.global.min.js       # Vendored offline Vue 3 runtime library (186 KB)
โ”‚   โ””โ”€โ”€ components/
โ”‚       โ”œโ”€โ”€ ontologyUtils.js        # Canonical DOMAIN/RANGE keys & recursive extractClassRefs (84 lines)
โ”‚       โ”œโ”€โ”€ LinkComponent.js        # Internal term link generator with CURIE resolution (54 lines)
โ”‚       โ”œโ”€โ”€ PropertyDiagramComponent.js # Arrow diagrams with multi-domain & multi-range shapes (94 lines)
โ”‚       โ”œโ”€โ”€ RowComponent.js         # Table row component with language filtering & deprecation tags (90 lines)
โ”‚       โ”œโ”€โ”€ TableComponent.js       # Dynamic collection table wrapper with sortable columns (46 lines)
โ”‚       โ”œโ”€โ”€ SearchResultsComponent.js # Multi-category accordion search results (36 lines)
โ”‚       โ””โ”€โ”€ TermComponent.js        # Single-term inspector, hierarchy trees & annotations (201 lines)
โ””โ”€โ”€ data/
    โ”œโ”€โ”€ .htaccess                   # Points active vocabulary version (RewriteRule ^gs1Voc.jsonld$ 1.18.0/gs1Voc)
    โ”œโ”€โ”€ archive.php                 # Historical release browser & directory scanner (184 lines)
    โ”œโ”€โ”€ changeLog.json              # Historical work request implementations & change catalog (12 KB)
    โ”œโ”€โ”€ linktypes-generator.php     # Standalone utility script for link type exports (118 lines)
    โ””โ”€โ”€ 1.18.0/                     # Active vocabulary release directory
        โ”œโ”€โ”€ gs1Voc.jsonld           # Canonical uncompacted JSON-LD graph (1.92 MB, 8 blank nodes)
        โ”œโ”€โ”€ gs1Voc-compact.jsonld   # Compacted JSON-LD graph for lightweight consumers (1.41 MB)
        โ”œโ”€โ”€ gs1Voc.ttl              # Canonical W3C Turtle serialization (1.24 MB)
        โ”œโ”€โ”€ gs1Voc.cache.json       # Pre-parsed binary PHP cache with schemaVersion 4 (9.74 MB)
        โ”œโ”€โ”€ GS1-WebVoc-context.jsonld # Scoped JSON-LD @context definition (327 KB)
        โ”œโ”€โ”€ GS1-core-context.jsonld # Canonical core @context (1.6 KB)
        โ””โ”€โ”€ linktypes.json          # Curated catalog of GS1 Link Types (14 KB)

Interactive Schema & Data Artifacts In-Guide Inspector

Inspect pre-loaded GS1 data artifacts directly in the guide to examine data structures without opening massive raw JSON files in an IDE.

๐Ÿ“ฆ Data Artifacts Dictionary Browser

Showing {{ filteredArtifactRecords.length }} records
Key / Identifier Name / Property Value / Details
{{ rec.k }} {{ rec.name }} {{ rec.detail }}
No matching records found in selected artifact.

โš ๏ธ Showing first 50 matching records. Please refine search filter to view specific entries.

Production Integration Recipes

Drop-in recipes for consuming GS1 Web Vocabulary data across heterogeneous architectures.

<?php
// Ingest GS1 Web Vocabulary in PHP using OntologyRepository
require_once __DIR__ . '/OntologyRepository.php';

$repo = new OntologyRepository(__DIR__ . '/data');
$term = $repo->getTerm('Product');

if ($term) {
    echo "Label: " . $term['label'] . "\n";
    echo "Subclass of: " . implode(', ', $term['subClassOf']) . "\n";
    echo "Properties with Domain: " . count($term['propertiesWithDomain']) . " properties\n";
}
// Headless Node.js Microservice (HTTP Content Negotiation)
const https = require('https');

function fetchTermTurtle(term) {
  return new Promise((resolve, reject) => {
    https.get(`https://ref.gs1.org/voc/${term}`, {
      headers: { 'Accept': 'text/turtle' }
    }, (res) => {
      let data = '';
      res.on('data', chunk => data += chunk);
      res.on('end', () => resolve(data));
    }).on('error', reject);
  });
}

fetchTermTurtle('Product').then(ttl => console.log('Received Turtle:\n', ttl));
// Client-Side Fetch with Content Negotiation
async function loadGS1Term(term) {
  const response = await fetch(`https://ref.gs1.org/voc/${term}`, {
    headers: { 'Accept': 'application/ld+json' }
  });
  if (!response.ok) throw new Error(`HTTP Error: ${response.status}`);
  const jsonld = await response.json();
  console.log('Compacted JSON-LD entity:', jsonld);
  return jsonld;
}

loadGS1Term('address').then(entity => console.log(entity));
Section 3

GS1 Web Vocabulary Data Model & Structural Contracts

The GS1 Web Vocabulary represents a linked-data graph modeling trade items, organizations, places, certifications, offers, and logistics attributes. Every entity in the graph belongs to one of five core categories:

Category RDF / OWL Types CURIE / Identifier Pattern Architectural Purpose
Class rdfs:Class, owl:Class gs1:Product, gs1:Place Defines entity types and types of entities that can possess attributes.
Property rdf:Property, owl:DatatypeProperty, owl:ObjectProperty gs1:gtin, gs1:address Defines relationships and attributes connecting classes to datatypes or other classes.
Code List rdfs:Class where instances have type gs1:{CodeList} gs1:OrganizationStatus Controlled enumerations grouping standardized code values.
Code Value gs1:{CodeList} gs1:Active, gs1:Inactive Standard individual codes defined within a specific Code List enumeration.
Link Type owl:ObjectProperty with rdfs:subPropertyOf: gs1:linkType gs1:pip, gs1:allergenInfo Web resolution relations for GS1 Digital Link context queries.

Multi-Domain & Multi-Range Architecture (Schema.org vs. OWL Blank Nodes)

Historically, ontologies constrained properties to multiple classes using rdfs:domain or rdfs:range pointing to an anonymous blank node (e.g. _:u1 through _:u8 in gs1Voc.jsonld) defining an owl:unionOf relationship:

# Historical Blank Node Union Pattern in gs1Voc.jsonld
_:u1 a owl:Class ;
     owl:unionOf ( gs1:Organization gs1:Place ) .

gs1:address a owl:ObjectProperty ;
     rdfs:domain _:u1 ;
     rdfs:range gs1:PostalAddress .

While formally valid in OWL DL, blank nodes complicate property inspection and fail when applications expect direct class URIs. The updated runtime seamlessly tolerates both the historical owl:unionOf blank nodes and modern schema.org annotations:

# Modern Schema.org Inclusions Pattern (Fully Supported)
gs1:address a owl:ObjectProperty ;
     schema:domainIncludes gs1:Organization , gs1:Place ;
     schema:rangeIncludes gs1:PostalAddress .

Seamless Multi-Value Resolution

Both server-side PHP (extractClassRefs) and client-side JavaScript (ontologyUtils.js) expand blank nodes (_:u1 → gs1:Organization, gs1:Place) and parse single objects, arrays of objects, single strings, and arrays of strings across schema:domainIncludes, rdfs:domain, schema:rangeIncludes, and rdfs:range.

Normative Test Vectors Matrix & In-Guide Test Runner

Executable test suite verifying term resolution, multi-domain union expansion, and category classification directly in your browser.

โ–ถ Normative Ontology Test Suite

{{ overallTestStatus.label }}
Term ID Expected Type Expected Domain / Superclasses Expected Range / Subclasses Result
{{ vec.id }} {{ vec.type }} {{ vec.expectedDomain }} {{ vec.expectedRange }} {{ testResults[vec.id].passed ? `PASS (${testResults[vec.id].time}ms)` : 'FAIL' }} Pending
Section 4

Sequential & Causal Logic (Architecture & Lifecycle Pipeline)

The system implements a dual-mode hybrid architecture: **Server-Side Pre-Rendering (SSR)** on the initial HTTP request followed by **Progressive Client-Side Hydration** via Vue 3 once the browser environment activates.

End-to-End Lifecycle Sequence Diagram

Client Request (e.g. GET /voc/Product)
   โ”‚
   โ–ผ
Apache Web Server (.htaccess)
   โ”‚โ”€โ”€ Matches static asset (/js, /css, /data)? โ”€โ”€โ”€โ”€โ–บ Serve raw static file directly [HTTP 200]
   โ”‚
   โ”‚โ”€โ”€ Checks HTTP Accept header:
   โ”‚     โ”œโ”€โ”€ "text/turtle" โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Rewrite to index.php?term=Product&format=text/turtle
   โ”‚     โ””โ”€โ”€ "application/ld+json" โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Rewrite to index.php?term=Product&format=application/ld+json
   โ”‚
   โ–ผ
index.php Execution
   โ”‚โ”€โ”€ Instantiates OntologyRepository(__DIR__ . '/data')
   โ”‚     โ”œโ”€โ”€ Detects version from data/.htaccess or semver scan (e.g. "1.18.0")
   โ”‚     โ”œโ”€โ”€ Inspects data/{version}/gs1Voc.cache.json
   โ”‚     โ”‚     โ”œโ”€โ”€ Valid schemaVersion 4 cache? โ”€โ”€โ–บ Instant restore to memory (0.01s)
   โ”‚     โ”‚     โ””โ”€โ”€ Cache missing/stale? โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Parses gs1Voc.jsonld, builds index & saves cache
   โ”‚
   โ”‚โ”€โ”€ Evaluates Best Format (getBestMediaType):
   โ”‚     โ”œโ”€โ”€ text/turtle โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Generates/streams Turtle RDF โ”€โ”€โ–บ [HTTP 200 text/turtle]
   โ”‚     โ”œโ”€โ”€ application/ld+json โ”€โ–บ Generates compacted JSON-LD โ”€โ”€โ–บ [HTTP 200 application/ld+json]
   โ”‚     โ””โ”€โ”€ text/html (Default):
   โ”‚           โ”œโ”€โ”€ Looks up $termData in OntologyRepository index
   โ”‚           โ”œโ”€โ”€ Emits Open Graph & SEO meta tags
   โ”‚           โ”œโ”€โ”€ Serializes window.__INITIAL_STATE__ (basePath, term, owlUnionMap)
   โ”‚           โ””โ”€โ”€ Renders complete semantic SSR HTML markup into DOM โ”€โ”€โ–บ [HTTP 200 text/html]
   โ”‚
   โ–ผ
Browser Client Rendering
   โ”œโ”€โ”€ Immediate HTML Display: Full content visible even with JavaScript DISABLED
   โ”‚
   โ””โ”€โ”€ Client-Side Vue Hydration (if JavaScript ENABLED):
         โ”œโ”€โ”€ createApp.js mounts onto #app container
         โ”œโ”€โ”€ Ingests window.__INITIAL_STATE__ (zero network round-trips for initial term)
         โ”œโ”€โ”€ Fetches data/gs1Voc.jsonld in background for interactive client-side exploration
         โ””โ”€โ”€ Intercepts internal clicks for zero-reload SPA navigation via history.pushState()

HTTP Accept Header Negotiation Algorithm

The server parses standard HTTP Accept headers conforming to RFC 9110 Section 12.5.1, parsing quality factors (q=0.9), sorting candidates in descending order, and selecting the highest-priority media type:

Incoming Accept Header Example Sorted Preference Queue Selected Format Response Content-Type
text/turtle, application/ld+json;q=0.8, text/html;q=0.5 text/turtle (1.0) > application/ld+json (0.8) > text/html (0.5) Turtle text/turtle; charset=utf-8
text/html, application/xhtml+xml, application/xml;q=0.9 text/html (1.0) > application/xhtml+xml (1.0) HTML (SSR) text/html; charset=utf-8
application/ld+json, */*;q=0.1 application/ld+json (1.0) > */* (0.1) JSON-LD application/ld+json; charset=utf-8
*/* (Default curl without headers) Wildcard fallback HTML (SSR) text/html; charset=utf-8

URL Query String '+' Decoding Trap & Format Overrides

Developers and API clients frequently test machine-readable endpoints in web browsers using explicit URL query parameters like ?format=application/ld+json or ?format=text/turtle.

The URL Query String '+' Decoding Trap: Under RFC 1866 and standard application/x-www-form-urlencoded parsing rules, the plus character (+) represents a space. When a client requests ?format=application/ld+json, PHP's query parser automatically decodes the plus sign into a space, populating $_GET['format'] with the string "application/ld json".

If the application naively tests only $format === 'application/ld+json', the check evaluates to false. The request then falls through to the client's HTTP Accept header (which in web browsers prioritizes text/html), causing the server to unexpectedly return the full HTML application shell instead of the requested JSON-LD graph.

To prevent this failure, index.php normalizes spaces back to plus characters via str_replace(' ', '+', $formatParam) and tests an alias dictionary before evaluating the HTTP Accept header:

Target Format Accepted Query Parameter Aliases Resolved Media Type Content-Type Header
JSON-LD application/ld+json, application/ld json, jsonld, json-ld, application/jsonld, ld+json application/ld+json application/ld+json; charset=utf-8
RDF Turtle text/turtle, turtle, ttl, text/ttl, application/x-turtle text/turtle text/turtle; charset=utf-8
JSON application/json, json, text/json application/json application/json; charset=utf-8
HTML (SSR) text/html, html text/html text/html; charset=utf-8

Regex Constants & Pattern Deconstruction

Regex Constant / Pattern File & Scope Pattern Deconstruction Architectural Purpose
/^@prefix\s+[^.]+\./m OntologyRepository.php:L197 Matches multiline Turtle prefix declarations beginning with @prefix up to ending period. Extracts all namespace prefixes from gs1Voc.ttl for single-term Turtle generation.
/RewriteRule\s+\^gs1Voc.../i OntologyRepository.php:L83 Case-insensitive pattern extracting version folder (e.g. 1.18.0) from data/.htaccess. Dynamically resolves active ontology version without hardcoding.
/^[0-9]+(\.[0-9]+)*$/ OntologyRepository.php:L95 Numeric SemVer string matching digits separated by periods (e.g. 1.18.0, 2.0). Discovers candidate version folders in data/ for version resolution and archive generation.
/^\/+|\/+$/g index.php:L18, createApp.js:L26 Matches leading and trailing forward slashes across pathname strings. Sanitizes request paths to extract clean vocabulary term identifiers.
Section 5

Core Engine Codecs & Algorithmic Mechanics

The server-side ontology repository and client-side application execute coordinated indexing algorithms to map bidirectional semantic relationships.

Two-Pass Graph Indexing Algorithm (`OntologyRepository.php`)

To resolve forward and reverse property relationships (such as displaying all properties that expect a gs1:Product, or classes having property gs1:address) without multi-gigabyte in-memory triple stores, OntologyRepository.php executes a deterministic two-pass algorithm:

  1. Pre-Pass (Blank Node Indexing): Iterates through the entire JSON-LD @graph. Any node whose @id begins with _: and contains owl:unionOf has its member class list extracted and indexed into $owlUnionMap.
  2. Pass 1 (Term Registration & Forward Extraction): Iterates through non-blank nodes. Extracts classes, properties, code lists, and code values. Invokes extractClassRefs() across schema:domainIncludes, rdfs:domain, schema:rangeIncludes, and rdfs:range, automatically expanding any encountered blank node union references. Accumulates reverse mapping dictionaries: $childClassMap, $domainPropertyMap, and $rangePropertyMap.
  3. Pass 2 (Reverse Relationship Stitching): Iterates over the indexed primary terms, attaching resolved child classes to subClasses, domain properties to propertiesWithDomain, and range properties to propertiesWithRange.
  4. Caching (Schema Version 4): Serializes the completed bidirectional index, sorted collections, prefix header, and $owlUnionMap to disk in gs1Voc.cache.json. Subsequent requests bypass parsing entirely and restore in milliseconds.

Interactive Live Term & Content Negotiation Playground

Simulate server-side content negotiation, inspect generated HTTP response headers, and preview live Turtle and JSON-LD payloads.

๐Ÿงช Live Content Negotiation Simulator

Client-Side Engine Simulator
Quick Presets:
HTTP/1.1 200 OK โ€” Simulated Response for GET /voc/{{ playgroundTerm }}
Content-Type: {{ simulatedContentType }}
Vary: Accept, Accept-Encoding
Access-Control-Allow-Origin: *
Link: <https://ref.gs1.org/voc/{{ playgroundTerm }}>; rel="canonical"
{{ simulatedPayload }}
Section 6

Complete Codebase Reference Index

Exhaustive directory of all 42 public methods, internal algorithms, computed pipelines, and utility functions across the PHP backend and Vue 3 frontend components.

{{ openMethods[m.name] ? 'โ–ผ' : 'โ–ถ' }} {{ m.signature }}
{{ m.categoryBadge }} {{ m.file }}:{{ m.lines }}

{{ m.description }}

Parameters:

Parameter Type Description
{{ p.name }} {{ p.type }} {{ p.desc }}

Returns:

{{ m.returnType }} โ€” {{ m.returnDesc }}

{{ m.snippet }}
Section 7

UI Components & Reactive State Exploration

The client-side single-page application is structured as a collection of zero-build Vue 3 Options API components loaded natively as browser ES modules:

DOM Element & Component Directive Mapping

DOM Element / Component Source File Vue Directives & Events Controller Method & State Role
<term-component> TermComponent.js :term="termData" :owlunionmap="owlUnionMap" @set-term="setTerm" Renders primary term detail view, subclass trees, annotations, and code lists.
<property-diagram-component> PropertyDiagramComponent.js :term="term" :owlunionmap="owlunionmap" @set-term="setTerm" Renders SVG/CSS domain oval, arrow stack, and range shape with multi-class unions.
<row-component> RowComponent.js :term="term" :showdomain="showdomain" :showrange="showrange" Table row rendering label, CURIE link, status badge, domain, and range.
<table-component> TableComponent.js :rows="collection" :col1="col1" @set-term="setTerm" Encapsulates sortable collection tables with responsive overflow containers.
<search-results-component> SearchResultsComponent.js :collection="filteredClasses" :title="'Classes'" Accordion block presenting categorized keyword search matches with match counts.
<link-component> LinkComponent.js :term="id" @set-term="setTerm" Generates clickable CURIE hyperlinks with tooltip expansion and SPA navigation.

Reactive State Cascade Flow Diagram

User Interaction (e.g. clicks "gs1:address" or enters search keyword)
   โ”‚
   โ–ผ
setTerm(term) or searchKeyword Mutation
   โ”‚
   โ”œโ”€โ”€ Mutates reactive data():
   โ”‚     this.term = 'address';
   โ”‚     this.browseCollection = 'term';
   โ”‚
   โ”œโ”€โ”€ Synchronizes Browser History:
   โ”‚     window.history.pushState({ term: 'address' }, '', './address');
   โ”‚     document.title = 'gs1:address - GS1 Web Vocabulary';
   โ”‚
   โ”œโ”€โ”€ Triggers Reactive Computed Evaluation:
   โ”‚     โ”œโ”€โ”€ propertiesWithDomainMap re-evaluates via extractClassRefs()
   โ”‚     โ”œโ”€โ”€ propertiesWithRangeMap re-evaluates via extractClassRefs()
   โ”‚     โ””โ”€โ”€ termData computed looks up 'address' in active ontology graph
   โ”‚
   โ–ผ
DOM Template Cascade Updates:
   โ”œโ”€โ”€ <term-component> receives updated termData prop
   โ”œโ”€โ”€ <property-diagram-component> renders domain oval with [gs1:Organization, gs1:Place]
   โ”œโ”€โ”€ <property-diagram-component> renders range oval with [gs1:PostalAddress]
   โ””โ”€โ”€ Inactive home overview hides cleanly via v-if="(term == '')"
Section 8

Maintenance, Extension & Succession Guide

Actionable procedures for future maintainers to update the vocabulary, introduce Application Identifiers, manage term deprecations, and resolve runtime issues.

Step-by-Step: Adding a New GS1 Vocabulary Term

  1. Define Term in JSON-LD (data/{version}/gs1Voc.jsonld): Add the entity block to the @graph array. For a property with multiple domains or ranges, prefer modern schema.org inclusion patterns:
    {
      "@id": "gs1:customIdentifier",
      "@type": ["rdf:Property", "owl:ObjectProperty"],
      "rdfs:label": {"@language": "en", "@value": "Custom Identifier"},
      "rdfs:comment": {"@language": "en", "@value": "A unique custom identifier assigned to a place or entity."},
      "schema:domainIncludes": [
        {"@id": "gs1:Organization"},
        {"@id": "gs1:Place"}
      ],
      "schema:rangeIncludes": {"@id": "xsd:string"},
      "sw:term_status": "testing"
    }
  2. Define Equivalent Turtle (data/{version}/gs1Voc.ttl): Append the triple block ensuring correct prefix references:
    gs1:customIdentifier a rdf:Property , owl:ObjectProperty ;
        rdfs:label "Custom Identifier"@en ;
        rdfs:comment "A unique custom identifier assigned to a place or entity."@en ;
        schema:domainIncludes gs1:Organization , gs1:Place ;
        schema:rangeIncludes xsd:string ;
        sw:term_status "testing" .
  3. Invalidate Cache (gs1Voc.cache.json): Delete or allow the repository to auto-regenerate the cache. The repository compares file modification timestamps (mtime) and regenerates gs1Voc.cache.json automatically on next request.
  4. Verify SSR & Conneg Output:
    curl -i -H "Accept: text/turtle" https://ref.gs1.org/voc/customIdentifier
    curl -i -H "Accept: application/ld+json" https://ref.gs1.org/voc/customIdentifier

Troubleshooting & Common Pitfalls Matrix

Issue / Symptom Root Cause Actionable Resolution Procedure
HTTP 404 on Direct Term URLs (e.g. /voc/Product) Apache mod_rewrite disabled or AllowOverride All omitted in virtual host configuration. Enable mod_rewrite in Apache (a2enmod rewrite) and verify that Directory stanza sets AllowOverride All so .htaccess rules execute.
Stale Vocabulary Served After Editing JSON-LD gs1Voc.cache.json cache timestamp is equal to or newer than edited source file. Delete data/{version}/gs1Voc.cache.json manually, or run touch data/{version}/gs1Voc.jsonld to trigger automatic cache rebuilding.
TypeError in Browser: Cannot read properties of undefined (reading '@id') Client-side component assumed rdfs:domain exists as a single object on property nodes. Ensure components use extractClassRefs(term, DOMAIN_KEYS, owlunionmap) from ontologyUtils.js, which safely tolerates arrays, strings, and missing keys.
CORS Errors Fetching Turtle/JSON-LD from External Web App Missing Access-Control-Allow-Origin: * header in HTTP response. Verify that .htaccess includes Header always set Access-Control-Allow-Origin "*" and that Apache mod_headers is enabled (a2enmod headers).
Blank Node ID (e.g. _:u1) Appears Literally in Property Diagram Property references blank node union but owlUnionMap failed to index member classes. Ensure cache schema version is 4 in OntologyRepository.php so $owlUnionMap is restored from cache and passed into window.__INITIAL_STATE__.
Accordion Blocks Default to Open with JavaScript Disabled SSR HTML template applied open attribute unconditionally to <details>. Ensure index.php checks $showCollection or $searchKeyword before setting open on SSR collection and search details blocks.
โ–ฒ