Compile JSON-LD (Decentralized Identifiers and Verifiable Credentials) to Cypher.
npm i -g @transmute/jsonld-to-cypher@latest
jsonld-to-cypher convert ./examples/minimal-vc/minimal-vc.json
jsonld-to-cypher convert ./examples/v1-vc-jwt/v1-vc-jwt.jwt -- --type jwt
npm i @transmute/jsonld-to-cypher@latest --save
See minimal-vc.
const { cypher, graph } = await Cypher.fromDocument({
'@context': ['https://www.w3.org/2018/credentials/v1'],
type: ['VerifiableCredential'],
issuer: 'https://example.edu/issuers/565049',
issuanceDate: '2010-01-01T19:23:24Z',
credentialSubject: {
id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
},
})
name: Demo
on: [workflow_dispatch]
jobs:
merge:
runs-on: ubuntu-latest
name: Merge
steps:
- name: Merge Query from Document
uses: transmute-industries/[email protected]
id: merge
with:
neo4j-uri: ${{ secrets.NEO4J_URI }}
neo4j-user: ${{ secrets.NEO4J_USERNAME }}
neo4j-password: ${{ secrets.NEO4J_PASSWORD }}
operation: merge
document: |
{
"@context": ["https://www.w3.org/2018/credentials/v1"],
"type": ["VerifiableCredential"],
"issuer": "https://example.edu/issuers/565049",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21"
}
}
npm i
npm t
npm run jsonld-to-cypher convert ./examples/minimal-vc/minimal-vc.json
jq -r '.jws' ./examples/v1-vc-jwt/v1-vc-jwt.json > ./examples/v1-vc-jwt/v1-vc-jwt.jwt
npm run jsonld-to-cypher convert ./examples/v1-vc-jwt/v1-vc-jwt.jwt -- --type jwt
act -j neo4j-merge-documents-local --secret-file .env
See https://neo4j.com.