graph
Run graph-specific workflows.
Mapping docs:
- Reference:
docs/graph-sync-mappings-reference.md - Guide:
docs/graph-sync-mappings-guide.md - Examples:
docs/graph-sync-mappings-examples.md
Usage
worai graph sync run [--debug]worai --config <path> --profile <name> graph sync run [--debug]worai graph sync create <destination> [--template <src>] [--defaults] [--data-file <path>] [--vcs-ref <ref>] [--non-interactive] [--force]worai graph export [--validate] [output_file_name]worai graph validate <file-or-url> [<file-or-url> ...] [--builtin-shape <name>] [--exclude-builtin-shape <name>] [--shape <file-or-url>] [--level warning|error] [--format text|json]worai graph property delete <predicate> [--dry-run] [--yes] [--workers <n>] [--retries <n>] [--rate-delay <s>] [--limit <n>]worai graph audit <file> [--depth <n>] [--list-isolated-iris] [--show-url-violations] [--rich-snippets-granularity counts|entities] [--workers <n>] [--builtin-shape <name>] [--exclude-builtin-shape <name>] [--shape <file>] [--issue-level warning|error] [--format text|json]worai graph kpis calculate <file> [--website-host <host>] [--graph-host <host>] [--builtin-shape <name>] [--exclude-builtin-shape <name>] [--shape <file>] [--no-builtin-shapes] [--depth <n>] [--issue-level warning|error] [--shacl-workers <n>] [--output <file>]worai graph kpis payload <file> [--snapshot-date YYYY-MM-DD] [--website-host <host>] [--output <file>]worai graph kpis push <file> [--snapshot-date YYYY-MM-DD] [--website-host <host>] [--api-url <url>] [--timeout <seconds>] [--output <file>] [--details-output <file>]worai graph reset [--keep-country] [--keep-language] [--keep-url] [--yes]
Notes
graph sync runexecutes the graph sync workflow for a profile inworai.toml.graph sync createbootstraps a new graph sync project from a Copier template.graph sync createenables Copier trusted mode by default, so template_tasksrun automatically.graph exportdownloads graph data from/dataset/exportand writes it to a local file.- profile resolution is: root
--profile, thenWORAI_PROFILE, thendefault. - API key resolution is
profiles.<name>.api_keyfirst, thenWORDLIFT_API_KEY. - output format is inferred from file extension:
.ttl->text/turtle.nt->application/n-triples.nq->application/n-quads.rdf/.xml->application/rdf+xml.jsonld/.json->application/ld+json
- when no output file is passed, default name is
export_<profile>_<yyyyMMdd>_<seq>.ttl(sequence starts at1and increments if the file already exists). --validateruns SHACL validation on the exported file right after download; the command fails on SHACL errors or warnings.
- profile resolution is: root
graph validatevalidates one or more local files or URLs.--builtin-shapeincludes selected packaged shape names.--exclude-builtin-shaperemoves packaged shapes from the active set.--shapeadds extra shape files/URLs.--level warning|errorcontrols failure threshold (warningfails on warnings+errors,errorfails only on errors).--format text|jsonselects report output format.
graph property deleteremoves one predicate from all matching entities.- accepts full IRI (
https://w3id.org/seovoc/html) or CURIE (seovoc:html). - includes private fields by default (
X-include-Private: true) for both matching-entity discovery and deletion PATCH requests. --dry-runreports matching entities without patching.- without
--yes, the command asks for confirmation before patching.
- accepts full IRI (
--non-interactiveis implemented by enabling Copier defaults mode and skipping prompts; required unanswered fields still fail fast.- Supported input sources:
urls(explicit URL list)sitemap_url(+ optionalsitemap_url_pattern)- Google Sheets (
sheets_url+sheets_name+sheets_service_account) - configure exactly one source mode per run.
graph sync runprofile resolution is: root--profile, thenWORAI_PROFILE, thendefault.- Config path comes from root
worai --config ...when provided. - Without root
--config, standard worai config discovery applies (WORAI_CONFIG, nearestworai.tomlfrom current directory upward,~/.config/worai/config.toml,~/.worai.toml). .envis auto-loaded at CLI startup; aWORAI_CONFIGvalue from.envis honored unlessWORAI_CONFIGis already set in the environment.- Logging precedence is: root
--log-level, thenWORAI_LOG_LEVEL, thenprofiles.<name>.log_level, thenprofiles._base.log_level, then globallog_level, theninfo. - During
graph sync run, the resolved effective level is propagated tomorph-kgcaslogging_levelsowarningsuppresses morphINFOlogs (for examplemapping_partitioner) whileinfoallows them. sheets_service_accountaccepts either inline JSON or a file path.- The command fails if the selected profile has no
api_key. google_search_consolecan be set globally or per profile inworai.toml.- profile value overrides global value.
- default is
falsewhen unset. - mapped to SDK setting
GOOGLE_SEARCH_CONSOLE.
postprocessor_runtimecan be set globally or per profile inworai.toml.- profile value overrides global value.
- accepted values:
oneshot,persistent. - SDK 6 default is
persistent; setoneshotto preserve legacy one-shot behavior. - when set, exported as env var
POSTPROCESSOR_RUNTIMEduringgraph sync run.
canonical_id_strategycan be set globally or per profile inworai.toml(requires SDK 6.12.3+).- profile value overrides global value.
- accepted values:
legacy(default),dependency_graph. - forwarded to the SDK as
CANONICAL_ID_STRATEGYviaextra_settings. - use
dependency_graphwhen postprocessors mint FAQ child entities (e.g. an Article also typed as FAQPage with Question nodes viaschema:mainEntity) before canonical IRIs are finalized;legacymode leaves those questions under the stale pre-canonical root IRI. - can also be set via env var
CANONICAL_ID_STRATEGY=dependency_graph.
- Callback telemetry for
graph sync run:graph sync runusesrun_cloud_workflowand logs per-graph progress events and one final KPI summary.on_infolifecycle messages remain supported and are logged as info events.- debug artifacts are written by the SDK protocol callback to
output/debug_cloud/<profile>/(relative to the invocation current working directory):static_templates.ttlcloud_<sha256(url)>.ttlfor each callback URL.
- SDK
wordlift-sdk5.1.1+ postprocessor context changes:context.settingsremoved; read fromcontext.profile(example:context.profile["settings"]["api_url"]).context.account.keyremoved; usecontext.account_key.context.accountremains the clean/meaccount object.
web_page_import_timeoutinworai.tomlis interpreted as seconds and converted to milliseconds for the SDK.- example:
web_page_import_timeout = 60->60000ms - explicit suffixes are also supported:
60s,60000ms
- example:
- SDK 6 ingestion settings are forwarded when present:
ingest_source:auto|urls|sitemap|sheets|localingest_loader:auto|simple|proxy|playwright|premium_scraper|web_scrape_api|passthroughingest_passthrough_when_html: defaulttrue
- With
wordlift-sdk>=6.10.0,ingest_timeout_msdefaults to30000in the SDK and is forwarded asINGEST_TIMEOUT_MSonly when explicitly configured in worai. - SDK 6 cloud-flow migration deprecates integration reliance on:
WEB_PAGE_IMPORT_MODEWEB_PAGE_IMPORT_TIMEOUT
- SDK 6.2 SHACL validation settings:
- use
shacl_validate_mode = "warn"|"fail"|"off" - use
shacl_builtin_shapes,shacl_exclude_builtin_shapes,shacl_extra_shapes shacl_validate_syncandshacl_shape_specsare no longer supported
- use
Example ingestion config:
[profiles.acme]
api_key = "wl_..."
sitemap_url = "https://example.com/sitemap.xml"
ingest_source = "sitemap"
ingest_loader = "web_scrape_api"
ingest_passthrough_when_html = true
ingest_timeout_ms = 30000
playwright_wait_until = "domcontentloaded"
sheets_service_accountis required only when using Google Sheets source (sheets_url+sheets_name).- Failure cases for
sheets_service_account(Sheets source only):- value is missing or empty
- value is neither valid JSON object content nor an existing file path
- JSON content is valid JSON but not an object
Example profile config:
[profiles.acme]
api_key = "wl_..."
google_search_console = true
postprocessor_runtime = "persistent"
canonical_id_strategy = "dependency_graph"
sheets_service_account = "./service-account.json"
# or inline JSON string:
# sheets_service_account = "{\"type\":\"service_account\",...}"
graph auditaudits a local RDF file for schema compliance, rich snippets coverage, and graph connectivity (requires wordlift-sdk>=6.11.0).<file>accepts TTL, JSON-LD, NT, or RDF/XML.--depth <n>controls subgraph expansion depth for schema compliance checks (default: 1).--list-isolated-irisincludes the IRI list for each isolated subgraph in the report.--show-url-violationslists each failing URL with its SHACL violations.--rich-snippets-granularity counts|entitiescontrols detail level of rich snippets section (default: counts).--workers <n>sets max worker processes for SHACL validation (default: auto).--builtin-shapeand--exclude-builtin-shapeare mutually exclusive.--shape <file>appends an extra local.ttlshape file; repeat for multiple.--issue-level warning|errorfilters the issue severity shown (default: warning).--format text|jsonselects report output format (default: text).- exits with code 1 if load errors are encountered.
graph kpiscalculates compact graph KPI snapshots from a local RDF export (requires wordlift-sdk>=8.3.3).calculatewrites the detailed KPI JSON for inspection or artifacts.payloadwrites the numeric-only WordLift API payload for a dated snapshot.pushcalculates the snapshot, resolves the selected account through the WordLift API, and uploads withPUT /accounts/{id}/graph-kpis/{snapshot_date}.--website-hostscopes URL coverage and duplicate URL KPIs to the customer website host.--graph-hostmarks graph dataset hosts as internal when computing broken internal edges; repeat for multiple hosts.- URL-rooted SHACL compliance validates first-level entities with
schema:urlat--depth 1by default. --no-builtin-shapesruns only shapes passed with--shape, useful for fast scheduled KPI gates.--shacl-workersparallelizes URL-level SHACL validation for larger graphs.--details-outputonpushwrites the detailed KPI snapshot without recalculating.
graph resetresets the WordLift account associated with the current profile (requires wordlift-sdk>=6.12.0).- Destructive and irreversible — prompts for confirmation unless
--yesis passed. --keep-countrypreserves the account country on reset.--keep-languagepreserves the account language on reset.--keep-urlpreserves the account URL on reset.- API key is resolved from the active profile (
profiles.<name>.api_key) orWORDLIFT_API_KEY.
- Destructive and irreversible — prompts for confirmation unless
Examples
worai --profile acme graph sync runworai --config ./worai.toml --profile acme graph sync runworai --profile acme graph sync run --debugworai graph sync create ./acme-graphworai graph sync create ./acme-graph --template ./graph-sync-templateworai graph sync create ./acme-graph --data-file ./answers.yml --non-interactiveworai graph sync create ./acme-graph --vcs-ref v1.2.3worai graph exportworai --profile acme graph exportworai --profile acme graph export ./acme-export.jsonldworai graph export ./acme-export.ttl --validateworai graph validate ./acme-export.ttlworai graph validate ./acme-export.ttl ./acme-export.jsonld --builtin-shape google-required --exclude-builtin-shape schemaorg-grammar --shape ./custom.ttl --level warning --format jsonworai graph property delete seovoc:html --dry-runworai graph property delete https://w3id.org/seovoc/html --yes --workers 4worai graph audit ./acme-export.ttlworai graph audit ./acme-export.ttl --format json --show-url-violationsworai graph audit ./acme-export.ttl --rich-snippets-granularity entities --issue-level errorworai graph audit ./acme-export.ttl --builtin-shape google-required --shape ./custom.ttlworai --profile acme graph kpis calculate ./acme-export.ttl --website-host www.example.com --output graph-kpis.jsonworai --profile acme graph kpis payload ./acme-export.ttl --snapshot-date 2026-06-29 --website-host www.example.com --output graph-kpi-payload.jsonworai --profile acme graph kpis push ./acme-export.ttl --snapshot-date 2026-06-29 --website-host www.example.com --shacl-workers 4 --output graph-kpi-payload.json --details-output graph-kpis.jsonworai --profile acme graph kpis push ./acme-export.ttl --snapshot-date 2026-06-29 --website-host www.example.com --no-builtin-shapes --shape profiles/_base/shapes/graph-kpis-url-roots.shacl.ttl --output graph-kpi-payload.json --details-output graph-kpis.jsonworai --profile acme graph reset --yesworai --profile acme graph reset --keep-country --keep-language