This folder provides ready-to-use sample projects and simulation scripts to demonstrate how projects can automatically extract provenance metadata, generate canonical Sourcelume 0.0.1 Provenance Records, validate them against schema definitions, and publish them to a Sourcelume Registry.
helloworld-sample/: A sample Java/Maven Hello World project configured with sourcelume-maven-plugin.helloworld-cmake-sample/: A sample C++/CMake Hello World project configured with sourcelume-cmake-module.simulate-run.sh: Automated simulation runner for Maven projects.simulate-run-cmake.sh: Automated simulation runner for CMake projects.Make sure the tooling plugin is installed in your local Maven repository (~/.m2/repository):
# From repository root mvn clean install
Run the end-to-end simulation runner:
chmod +x examples/simulate-run.sh ./examples/simulate-run.sh
You can test individual goals directly in examples/helloworld-sample:
cd examples/helloworld-sample
Generates ${project.build.directory}/sourcelume/provenance-record.json based on POM coordinates, developers, and license metadata:
mvn compile sourcelume:generate
You can inspect the generated JSON-LD spec file:
cat target/sourcelume/provenance-record.json
Example output:
{ "@context": "https://sourcelume.apache.org/context/0.0.1/sourcelume.jsonld", "id": "https://sourcelume.apache.org/records/rec-maven-org.apache.sourcelume.examples-sourcelume-helloworld-sample-1.0.0-SNAPSHOT", "type": "ProvenanceRecord", "identifier": "sourcelume://datasets/sample-helloworld-corpus-v1", "name": "Sourcelume Hello World Example Dataset", "version": "1.0.0-SNAPSHOT", "license": "https://spdx.org/licenses/Apache-2.0.html", "licenseCategory": "open-source", "licenseNote": "Apache-2.0 verified example dataset & code", "creator": [ { "type": "schema:Organization", "name": "The Apache Software Foundation", "role": "originator" }, { "type": "schema:Person", "name": "Sourcelume Example Contributor", "role": "originator" } ], "created": "2026-10-12T09:49:00Z", "added": "2026-10-12T09:49:00Z", "contentCreated": "2026-10-12T09:49:00Z", "origin": "Curated metadata from Maven POM: org.apache.sourcelume.examples:sourcelume-helloworld-sample:1.0.0-SNAPSHOT", "custodyChain": [ { "agent": "https://sourcelume.apache.org/agents/maven-plugin", "action": "maven_build_and_provenance_generation", "startTime": "2026-10-12T09:49:00Z" } ] }
Simulate publishing without sending network traffic:
mvn sourcelume:publish -Dsourcelume.dryRun=true
When running Apache Sourcelume Registry locally (http://localhost:8082):
# Validate against registry SHACL & JSON Schema validator mvn sourcelume:validate -Dregistry.url=http://localhost:8082 # Publish record to registry mvn sourcelume:publish -Dregistry.url=http://localhost:8082
Authentication flags can also be passed if required:
mvn sourcelume:publish \ -Dregistry.url=http://localhost:8082 \ -Dregistry.username=admin \ -Dregistry.password=admin
You can also test the CMake module workflow directly in examples/helloworld-cmake-sample:
cd examples/helloworld-cmake-sample # Build and generate provenance record cmake -B build -DBUILD_TESTING=ON cmake --build build cmake --build build --target sourcelume_generate # Dry-run publish SOURCELUME_DRY_RUN=1 cmake --build build --target sourcelume_publish # Live validation & publishing (when registry is running at localhost:8082) cmake --build build --target sourcelume_validate cmake --build build --target sourcelume_publish
Once published, you can query the record from the registry API or Apache Atlas:
# Query record by ID curl -s http://localhost:8082/records/urn%3Asourcelume%3Amaven%3Aorg.apache.sourcelume.examples%3Asourcelume-helloworld-sample%3A1.0.0-SNAPSHOT | jq . # Or query dataset in Atlas curl -s "http://localhost:8082/api/v1/datasets?qualifiedName=urn%3Asourcelume%3Amaven%3Aorg.apache.sourcelume.examples%3Asourcelume-helloworld-sample%3A1.0.0-SNAPSHOT" | jq .