This document provides guidance on how to test the Cogitare Link TypeScript implementation, including the linked data navigation CLI and LLM adapter utilities.
For a complete understanding of the project and its testing approach, read these documentation files in the following order:
- README.md - Overview of the project architecture and components
- CLAUDE.md - Project-specific instructions for Claude Code
- LINKED_DATA_CLI.md - Testing instructions for the linked data navigation CLI
- LLM_ADAPTER_GUIDE.md - Guide for using the LLM adapter utilities
- DEVELOPER_GUIDE.md - Detailed information for developers extending the CLI
Before testing, prepare your environment:
# Install dependencies
npm install
# Build the project
npm run buildFollow these steps to test the linked data navigation CLI:
- Start with the basic vocabulary exploration:
# List available vocabularies
npm run navigate -- vocabs
# Explore a specific vocabulary
npm run navigate -- explore schema- Create and load a sample dataset:
# Create a mock dataset
npm run navigate -- create-mock --output test-dataset.jsonld
# Load the example dataset
npm run navigate -- load example/navigation-example.jsonld --vocab schema,dc,foaf,dcat- Navigate through the linked data:
# Navigate from a specific entity
npm run navigate -- navigate https://example.org/datasets/ldnb
# Run a SPARQL query
npm run navigate -- query "SELECT ?name WHERE { ?person a <https://schema.org/Person> ; <https://schema.org/name> ?name . }" --vocab schema- Run the interactive demo for a guided experience:
npm run demo:navigateFollow these steps to test the LLM adapter utilities:
- Create and load a sample dataset (if not already done):
npm run navigate -- create-mock --output test-dataset.jsonld
npm run navigate -- load test-dataset.jsonld --vocab schema,dc,foaf,dcat- Test the graph summarization for LLMs:
npm run navigate -- llm-summarize- Test vocabulary summarization for LLMs:
npm run navigate -- llm-vocab schema --max-terms 10- Extract a focused subgraph:
# First, find a dataset URI from your graph
npm run navigate -- query "SELECT ?dataset WHERE { ?dataset a <https://schema.org/Dataset> } LIMIT 1" --vocab schema
# Then extract a subgraph using that URI
npm run navigate -- llm-extract <DATASET_URI> --depth 2 --format turtle- Run the LLM adapter demo for a guided experience:
npm run demo:llmTo test with Claude Code, follow these steps:
-
Start a new Claude Code session to ensure a clean environment
-
Use these prompts in order:
a. Understanding the project:
I have a TypeScript project called cogitarelink-ts for linked data processing. It has a CLI for linked data navigation and utilities for LLM adaptation. Please help me understand its structure and capabilities.b. Testing the navigation CLI:
Let's test the linked data navigation CLI. Please run the following commands: 1. Build the project with `npm run build` 2. List available vocabularies with `npm run navigate -- vocabs` 3. Explore the schema.org vocabulary with `npm run navigate -- explore schema`c. Testing with sample data:
Now, let's test with sample data: 1. Create a mock dataset with `npm run navigate -- create-mock --output test-dataset.jsonld` 2. Load the example dataset with `npm run navigate -- load example/navigation-example.jsonld --vocab schema,dc,foaf,dcat` 3. Run a SPARQL query to find all persons in the datasetd. Testing the LLM adapter utilities:
Let's test the LLM adapter utilities: 1. Create a graph summary with `npm run navigate -- llm-summarize` 2. Get a vocabulary summary with `npm run navigate -- llm-vocab schema --max-terms 10` 3. Extract a subgraph from one of the dataset entities in the graph -
For interactive demos, you may want to run these locally (Claude Code's interactive capabilities are limited):
npm run demo:navigate npm run demo:llm
You should see:
-
Navigation CLI:
- Vocabulary listings with prefixes and URIs
- Detailed vocabulary information when exploring
- Entity links and properties when navigating
- SPARQL query results in tabular format
-
LLM Adapter:
- Graph summaries with statistics and key nodes
- Vocabulary summaries with important terms
- Focused subgraphs in concise or Turtle format
If you encounter issues:
- Ensure the project is built with
npm run build - Check that all dependencies are installed correctly
- Verify file paths in the commands match your environment
- Look for error messages in the console output
To thoroughly test the system:
- Create your own JSON-LD files with complex linked data
- Write SPARQL queries that navigate through multiple links
- Test with larger datasets to verify LLM adaptation capabilities
- Create custom CLI commands using the developer guide