Skip to content

Instantly share code, notes, and snippets.

View tpluscode's full-sized avatar

Tomasz Pluskiewicz tpluscode

View GitHub Profile
@tpluscode
tpluscode / .eslintrc.json
Created March 18, 2024 16:59
lit/no-classfield-shadowing
{
"extends": [
"@open-wc/eslint-config",
"@tpluscode"
],
"env": {
"browser": true
},
"parserOptions": {
"project": "./tsconfig.json"
@tpluscode
tpluscode / cas-context.json
Last active February 26, 2024 21:25
Converting CSS from INCEpTION to RDF
{
"@vocab": "urn:cas:",
"element": {
"@id": "element",
"@container": "@set",
"@type": "@id"
},
"__Entity": {
"@id": "urn:cas:entity",
"@type": "@id"
@tpluscode
tpluscode / book.ttl
Last active September 21, 2023 11:56
SHACL-UI view layout concepts
<book/a-macska-es-a-puding>
a schema:Book ;
schema:title "A Macska és a puding" ;
schema:author [ schema:givenName "Biljana" ; schema:familyName "Nikolic" ] ;
schema:associatedMedia [
schema:contentUrl <book/a-macska-es-a-puding.pdf> ;
] ;
schema:image [
a schema:ImageObject ;
schema:contentUrl <large-cover> ;
@tpluscode
tpluscode / .gitignore
Last active March 20, 2023 10:36
import default - node16
node_modules
@tpluscode
tpluscode / tui-editor.js
Created June 24, 2022 11:44
lit-tui-editor
import { css, html, LitElement, unsafeCSS } from 'lit'
import { customElement, property } from 'lit/decorators.js'
import Editor from '@toast-ui/editor'
import styles from '@toast-ui/editor/dist/toastui-editor.css'
@customElement('tui-markdown')
export class TuiMarkdown extends LitElement {
@property({ type: String })
public value: string | undefined = ''
@tpluscode
tpluscode / package.json
Created May 23, 2022 14:16
ts-node+mocha+esm+@types
{
"name": "mocha-ts-node",
"type": "module",
"scripts": {
"test": "mocha test.ts"
},
"dependencies": {
"@rdfjs/term-set": "2.0.1",
"@types/mocha": "9.1.1",
"@types/rdfjs__term-set": "2.0.0",
@tpluscode
tpluscode / .gitignore
Last active January 13, 2022 11:25
esbuild mirador
node_modules/
js/
@tpluscode
tpluscode / readme.md
Last active December 14, 2021 06:43
Annotating Hydra collection search template with SHACL Advanced Features

This is an idea for how SHACL AF Node Expression can be used to annotate a hydra search template so that values coming from the request query string would be transformed to SPARQL patterns an injeced into the resulting query

The collection resource <shapes> supports a targetNode query string parameter which should be translated to a SPARQL union like below. The $this token will represent each collection member (instance of shape). For example, when requesting shapes?targetNode=foobar, the generated patterns could be:

{
  # query the target node directly
  $this sh:targetNode <foobar>
}
UNION
@tpluscode
tpluscode / data.ttl
Created December 9, 2021 16:34
SHACL Compound properties
<data-file>
a schema:MediaObject ;
schema:identifier "sample-data.csv" ;
schema:encodingFormat "text/csv";
schema:contenUrl <https://s3.link/ugly-guid-link-whatever.csv>
.
@tpluscode
tpluscode / api.ttl
Last active April 14, 2021 10:54
Hydra relative
<api>
a hydra:ApiDocumentation ;
hydra:supportedClass :UserCollection ;
.
:UserCollection
a hydra:Class ;
hydra:supportedProperty [
hydra:property :searchUsers ;
] ;