Copier template for bootstrapping a worai graph sync project.
This repository provides:
- template configuration (
copier.yml) - runtime config template (
worai.toml.jinja, rendered asworai.toml) - profile assets (
profiles/*) - optional local postprocessor example (
src/acme_kg/postprocessors/youtube.py) - GitHub Actions workflow template (
.github/workflows/graph-sync.yml.jinja, rendered as.github/workflows/graph-sync.yml)
copier copy . ../my-graph-projectOr from a remote repository:
copier copy gh:wordlift/graph-build-template my-graph-projectapi_keysource_type(urls,sitemap,google_sheets)
urls:urlssitemap:sitemap_url, optionalsitemap_url_patterngoogle_sheets:sheets_url,sheets_name,sheets_service_account
overwriteconcurrency(default4, hidden prompt)web_page_import_mode(default"", hidden prompt)web_page_import_timeout(default120, hidden prompt)google_search_console(defaultfalse, hidden prompt)profiles(default["default"], hidden prompt)default_profile(default"default", hidden prompt; must be one ofprofiles)validate_api_key(defaulttrue, hidden prompt; checks key via WordLift API during generation)
.github/workflows/graph-sync.yml- Manual input uses
profile(orall) - Matrix runs selected
profiles
- Copier generates
.envwith:WORDLIFT_API_KEYSHEETS_SERVICE_ACCOUNTYOUTUBE_API_KEY(empty by default)
- Copier validates
api_keyagainsthttps://api.wordlift.io/accounts/meby default. - Copier derives local runtime package name from
dataset_urireturned by/accounts/me: path is normalized and_graph_syncis appended. - Example:
https://data.wordlift.io/wl123/customer-x->wl123_customer_x_graph_sync. - If validation is skipped or API is unreachable, fallback package is
acme_graph_sync. - To skip validation in automation/offline mode, pass
--data validate_api_key=false. - Copier scaffolds
profiles/<profile>/mappingsandprofiles/<profile>/templatesfor all selected profiles. - Generated projects exclude template-maintenance tests (
tests/test_runtime_assets.py,tests/test_template_smoke.py).
- One static template file MUST define exactly one subject node.
- Static templates MUST NOT emit blank nodes.
- Every node MUST use explicit IRIs.
schema:urlandschema:sameAsin static templates MUST be URL literals.- Static template filenames MUST use depth prefixes (
10_,20_,30_, ...). - Exported root IRIs in
exports.toml(.j2)MUST remain stable/unhashed.
Default scaffold example:
profiles/default/templates/20_organization.ttl.j2profiles/default/templates/20_website.ttl.j2profiles/default/templates/40_organization_postal_address.ttl.j2
docs/INDEX.mddocs/QUICKSTART.mddocs/TEMPLATE_SETUP.mddocs/STATE_OF_ART.mddocs/WORAI_TOML_EXAMPLES.mdspecs/INDEX.md
- Split multi-node static files into one node per
.ttl(.j2/.liquid)file. - Rename static template files to depth-prefixed names derived from subject IRI depth.
- Replace
schema:url/schema:sameAsIRI objects with string URL literals. - Remove blank nodes by exporting explicit dependent IRIs in
exports.toml(.j2). - Keep exported top-level root IRIs stable (no URL hash suffix).
pytest -qscripts/smoke_render_template.sh(renders template and validatesworai.toml/.envoutput)