Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in the readme](https://github.com/changesets/changesets/blob/main/README.md)

To add a new changeset, run `npx changeset` in the root of the repository.
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "Semantu/linked" }
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/wide-baths-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@_linked/core": major
---

first major release
43 changes: 43 additions & 0 deletions .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Changeset Check

on:
pull_request:
branches:
- main
- dev

jobs:
changeset-check:
name: Check for changeset
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for changeset files
uses: actions/github-script@v7
with:
script: |
const { data: files } = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});

const hasChangeset = files.some(f =>
f.filename.startsWith('.changeset/') &&
f.filename.endsWith('.md') &&
f.filename !== '.changeset/README.md'
);

if (!hasChangeset) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: '⚠️ **No changeset found.** If this PR should trigger a release, run `npx changeset` and commit the generated file.\n\nIf this change doesn\'t need a release (docs, CI config, etc.), you can ignore this message.'
});
core.warning('No changeset file found in this PR.');
}
109 changes: 109 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Publish

on:
push:
branches:
- main
- dev

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Build
run: npm run build

- name: Test
run: npm test

release:
name: Publish Stable Release
needs: build-and-test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"

- name: Setup npm
run: npm install -g npm@^11.5.1

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Build
run: npm run build

- name: Create release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: npx changeset publish
title: "chore: version package for release"
commit: "chore: version package for release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

dev-release:
name: Publish Dev Release
needs: build-and-test
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"

- name: Setup npm
run: npm install -g npm@^11.5.1

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Build
run: npm run build

- name: Publish next release
run: |
# Apply pending changesets to get the next version (without committing)
npx changeset version
NEXT_VERSION=$(node -p "require('./package.json').version")
# Append dev prerelease identifier
DEV_VERSION="${NEXT_VERSION}-next.$(date +%Y%m%d%H%M%S)"
npm version "$DEV_VERSION" --no-git-tag-version
npm publish --tag next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Changelog

### 1.0.0 (from LINCD.js)

This is a rebranding + extraction release. It moves the core query/shape system into `@_linked/core` and removes RDF models and React-specific code.

Key changes:
- **New package name:** import from `@_linked/core` instead of `lincd`.
- **Node references everywhere:** use `NodeReferenceValue = {id: string}` everywhere. `NamedNode` does not exist in this package.
- **Before (LINCD.js):**
```typescript
import {NamedNode} from 'lincd/models';
const name = NamedNode.getOrCreate('https://schema.org/name');
```
- **After (`@_linked/core`):**
```typescript
import {createNameSpace} from '@_linked/core/utils/NameSpace';
const schema = createNameSpace('https://schema.org/');
const name = schema('name'); // {id: 'https://schema.org/name'}
```
- **Decorator paths:** property decorators now require `NodeReferenceValue` paths (no strings, no `NamedNode`).
- **Before:**
```typescript
@literalProperty({path: foaf.name})
```
- **After:**
```typescript
const name = schema('name');
@literalProperty({path: name})
```
- **Target class and node kinds:** `targetClass`, `datatype`, `nodeKind`, etc. now take `NodeReferenceValue`.
- **Before:**
```typescript
static targetClass = foaf.Person; // NamedNode
```
- **After:**
```typescript
static targetClass = schema('Person'); // {id: string}
```
- **Query context:** context values are `NodeReferenceValue` (or QResults) instead of RDF nodes.
- **Before:**
```typescript
setQueryContext('user', NamedNode.getOrCreate(userId), Person);
```
- **After:**
```typescript
setQueryContext('user', {id: userId}, Person);
```
- **No RDF models in core:** `NamedNode`, `Literal`, `BlankNode`, `Quad`, `Graph`, and all RDF collections are not available in `@_linked/core`. Use a store package (e.g. `@_linked/rdf-mem-store`) if you need RDF models or quad-level access.
- **Shape instances:** shape classes no longer carry RDF nodes or instance graph APIs. Decorated accessors register SHACL metadata but do not implement runtime get/set behavior.
- **Query tracing:** query tracing is proxy-based (no `TestNode`/`TraceShape`).
- **SHACL metadata:** node/property shapes are plain JS objects (`QResult`), not RDF triples.
- **Package registration:** `linkedPackage` now stores package metadata as plain JS (`PackageMetadata`) and keeps legacy URI ids for compatibility.
- **Storage routing:** `LinkedStorage` routes queries to an `IQuadStore` implementation (e.g. `@_linked/rdf-mem-store`).
- **Imports updated:** ontology namespaces now return `NodeReferenceValue` objects, and decorators require `NodeReferenceValue` paths.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Semantu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
54 changes: 1 addition & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,56 +323,4 @@ await Person.delete({id: 'https://my.app/node1'});

## Changelog

### 1.0.0 (from LINCD.js)

This is a rebranding + extraction release. It moves the core query/shape system into `@_linked/core` and removes RDF models and React-specific code.

Key changes:
- **New package name:** import from `@_linked/core` instead of `lincd`.
- **Node references everywhere:** use `NodeReferenceValue = {id: string}` everywhere. `NamedNode` does not exist in this package.
- **Before (LINCD.js):**
```typescript
import {NamedNode} from 'lincd/models';
const name = NamedNode.getOrCreate('https://schema.org/name');
```
- **After (`@_linked/core`):**
```typescript
import {createNameSpace} from '@_linked/core/utils/NameSpace';
const schema = createNameSpace('https://schema.org/');
const name = schema('name'); // {id: 'https://schema.org/name'}
```
- **Decorator paths:** property decorators now require `NodeReferenceValue` paths (no strings, no `NamedNode`).
- **Before:**
```typescript
@literalProperty({path: foaf.name})
```
- **After:**
```typescript
const name = schema('name');
@literalProperty({path: name})
```
- **Target class and node kinds:** `targetClass`, `datatype`, `nodeKind`, etc. now take `NodeReferenceValue`.
- **Before:**
```typescript
static targetClass = foaf.Person; // NamedNode
```
- **After:**
```typescript
static targetClass = schema('Person'); // {id: string}
```
- **Query context:** context values are `NodeReferenceValue` (or QResults) instead of RDF nodes.
- **Before:**
```typescript
setQueryContext('user', NamedNode.getOrCreate(userId), Person);
```
- **After:**
```typescript
setQueryContext('user', {id: userId}, Person);
```
- **No RDF models in core:** `NamedNode`, `Literal`, `BlankNode`, `Quad`, `Graph`, and all RDF collections are not available in `@_linked/core`. Use a store package (e.g. `@_linked/rdf-mem-store`) if you need RDF models or quad-level access.
- **Shape instances:** shape classes no longer carry RDF nodes or instance graph APIs. Decorated accessors register SHACL metadata but do not implement runtime get/set behavior.
- **Query tracing:** query tracing is proxy-based (no `TestNode`/`TraceShape`).
- **SHACL metadata:** node/property shapes are plain JS objects (`QResult`), not RDF triples.
- **Package registration:** `linkedPackage` now stores package metadata as plain JS (`PackageMetadata`) and keeps legacy URI ids for compatibility.
- **Storage routing:** `LinkedStorage` routes queries to an `IQuadStore` implementation (e.g. `@_linked/rdf-mem-store`).
- **Imports updated:** ontology namespaces now return `NodeReferenceValue` objects, and decorators require `NodeReferenceValue` paths.
See [CHANGELOG.md](./CHANGELOG.md).
Loading