Gathering detailed insights and metrics for @safs.io/unify
Gathering detailed insights and metrics for @safs.io/unify
npm install @safs.io/unify
Typescript
Module System
Node Version
NPM Version
73.9
Supply Chain
97.5
Quality
79
Maintenance
100
Vulnerability
99.6
License
Total Downloads
382
Last Day
5
Last Week
5
Last Month
15
Last Year
382
Minified
Minified + Gzipped
Latest Version
0.0.1-next.2
Package Id
@safs.io/unify@0.0.1-next.2
Unpacked Size
138.63 kB
Size
32.25 kB
File Count
84
NPM Version
10.7.0
Node Version
22.2.0
Publised On
03 Nov 2024
Cumulative downloads
Total Downloads
Last day
0%
5
Compared to previous day
Last week
-16.7%
5
Compared to previous week
Last month
-91.1%
15
Compared to previous month
Last year
0%
382
Compared to previous year
1
22
update version
then pnpm build
then pnpm publish --access=public
TCL
DQL
paging
sorting
filtering
aggregation
add ability to pass in an array to in
clause (for multiple values)
add ability to return bound variables (from in
clause) in find results
limit
support for nested queries
support for pull api
granularity of cache invalidation
IO
1// required find clause. variable must appear in where clauses. 2{ 3 find: ['?e'], 4 where: [['?e', ':type/name', 'del']] 5} 6 7// optional in clause. 8const query = { 9 find: ['?e'], 10 in: ['?name'], 11 where: [['?e', ':type/name', '?name']] 12} 13execute(query, ['del']) 14 15//multiple (connected) where clauses 16const query = { 17 find: ['?e'], 18 in: ['?name'], 19 where: [ 20 ['?e', ':type/name', '?name'], 21 ['?e', ':type/age', '?age'] 22 ] 23} 24 25//joined where clauses 26const query = { 27 find: ['?e'], 28 where: [ 29 ['?e', ':type/friend', '?f'], 30 ['?f', ':type/name', '?name'] 31 ] 32} 33 34//multiple (disconnected) where clauses 35//this essentially returns a cartesian product of the two where clauses 36const query = { 37 find: ['?e', '?name'], 38 where: [ 39 ['?e', ':type/friend', '?f'], 40 ['?f', ':type/name', '?name'] 41 ] 42}
unlike SQL, where joins are always between two tables, in Datalog, joins can be between any two patterns. instead of using a JOIN keyword, the parser will infer the presence of a join based on whether and how variables are shared between patterns.
1/* 2 entity-entity join 3 ?person is an entity that is a person 4 this query joins information about the same person 5 The key characteristic of an entity-entity join is that 6 it connects multiple facts about the same entity. It's 7 often used to retrieve different attributes of a single 8 entity or to apply multiple conditions to the same 9 entity. 10*/ 11const query = { 12 find: ['?person', '?name', '?age'], 13 where: [ 14 ['?person', ':name', '?name'], 15 ['?person', ':age', '?age'] 16 ] 17}; 18 19/* 20 entity-value join 21 In this entity-value join, ?person switches roles between the triples: it's a value in the first triple and an entity in the second. 22*/ 23const query = { 24 find: ['?department', '?managerName'], 25 where: [ 26 ['?department', ':manager', '?person'], 27 ['?person', ':name', '?managerName'] 28 ] 29}; 30 31/* 32 value-value join 33 this is a cartesian product of the two where clauses 34 where each ?person1 is joined with ?person2 35 because their `?age` is the same 36*/ 37const query = { 38 find: ['?person1', '?person2'], 39 where: [ 40 ['?person1', ':age', '?age'], 41 ['?person2', ':age', '?age'], 42 ['?person1', ':name', '?name1'], 43 ['?person2', ':name', '?name2'] 44 ] 45}; 46 47/* 48 implicit-join 49 this is an implicit join because the where clause is 50 not explicitly defined. the parser will infer that the 51 two ?person variables are the same entity. 52*/ 53const query = { 54 find: ['?person1', '?person2'], 55 where: [ 56 ['?person', ':name', '?name'], 57 ['?person', ':age', '?age'], 58 ] 59} 60 61
Everything you need to build a Svelte library, powered by create-svelte
.
Read more about creating a library in the docs.
If you're seeing this, you've probably already done this step. Congrats!
1# create a new project in the current directory 2npm create svelte@latest 3 4# create a new project in my-app 5npm create svelte@latest my-app
Once you've created a project and installed dependencies with npm install
(or pnpm install
or yarn
), start a development server:
1npm run dev 2 3# or start the server and open the app in a new browser tab 4npm run dev -- --open
Everything inside src/lib
is part of your library, everything inside src/routes
can be used as a showcase or preview app.
To build your library:
1npm run package
To create a production version of your showcase app:
1npm run build
You can preview the production build with npm run preview
.
To deploy your app, you may need to install an adapter for your target environment.
Go into the package.json
and give your package the desired name through the "name"
option. Also consider adding a "license"
field and point it to a LICENSE
file which you can create from a template (one popular option is the MIT license).
To publish your library to npm:
1npm publish
No vulnerabilities found.
No security vulnerabilities found.