Commit Graph

19 Commits

Author SHA1 Message Date
Jes Cok
bd727a9e14 all: fix typos 2023-07-16 13:37:17 +09:30
Dan Kortschak
5f0141ca4c all: run gofmt and generate all packages
Changes made in dsp/fourier/internal/fftpack break the formatting used
there, so these are reverted. There will be complaints in CI.

[git-generate]
gofmt -w .
go generate gonum.org/v1/gonum/blas
go generate gonum.org/v1/gonum/blas/gonum
go generate gonum.org/v1/gonum/unit
go generate gonum.org/v1/gonum/unit/constant
go generate gonum.org/v1/gonum/graph/formats/dot
go generate gonum.org/v1/gonum/graph/formats/rdf
go generate gonum.org/v1/gonum/stat/card

git checkout -- dsp/fourier/internal/fftpack
2022-08-06 07:05:17 +09:30
Dan Kortschak
a2c6f817bf ci: replace golangci-lint with staticcheck 2022-05-18 21:35:57 +09:30
Dan Kortschak
09c7f513f8 graph/formats/rdf: add Repeat and Len methods 2022-03-04 14:26:53 +10:30
Dan Kortschak
d5f7a1db26 graph/formats/rdf: add Has{All,Any}{Out,In} query methods
These methods express queries that are currently able to be expressed
with a sequence of In, Out and And queries. However, the constructed
filter approach is potentially significantly more expensive and are
more complex to reason about. For example it is often possible to make
the following re-writes,

    p.Out(cond).In(cond).And(p) => p.HasAllOut(cond')

and

    p.In(cond).Out(cond).And(p) => p.HasAllIn(cond').

The expense comes when reaching out to a commonly connected node and then
coming back; the return traversal will generate a large set of fruitless
candidates that then need to be filtered via the conjunction. This saves
that fruitless effort.
2022-03-04 14:26:53 +10:30
Dan Kortschak
1f712d5ee0 graph/formats/rdf: add deduplication function 2022-02-09 20:37:52 +10:30
Dan Kortschak
820f2999af graph/formats/rdf: add a graph implementation and graph query language for RDF graphs
This is a very simplified version of a Gremlin-like language. The
simplification is in part forced by Go, but also reduces the level
of hiding complexity that is present in Gremlin.
2022-02-01 06:57:30 +10:30
Dan Kortschak
3593b1ee88 graph/formats/rdf: fix typo 2022-02-01 06:57:30 +10:30
Dan Kortschak
03c2b7f8f1 graph/formats/rdf: fix typo 2021-11-02 05:56:02 +10:30
Dan Kortschak
e7ee7e1c97 graph/formats/rdf: work around unhelpful mechanical lawyer 2021-11-01 08:00:28 +10:30
Dan Kortschak
aad2065518 graph/formats/rdf: add equi-canonicalisation function 2021-09-28 08:29:48 +09:30
Dan Kortschak
af39aebcaa all: replace uses of deprecated ioutil functions 2021-08-17 20:06:07 +09:30
Dan Kortschak
85ca8969b8 all: remove or clarify repeated words in comments 2021-08-08 16:39:38 +09:30
Dan Kortschak
0164be019d graph/formats/rdf: use isBlank and isIRI helpers 2021-06-12 21:18:28 +09:30
Dan Kortschak
c8613b2ab9 graph/formats/rdf: fail early for dst mismatch 2021-06-03 17:31:15 +09:30
Dan Kortschak
3f0deff25e graph/formats/rdf: add URDNA2015 and URGNA2012 canonicalisation
With the inclusion of the complete JSON-LD RDF Dataset Normalization test
suite these can now be dual licensed.
2021-05-05 14:52:27 +09:30
Dan Kortschak
a6eddb68ae graph/formats/rdf: work on optimising performance of IsoCanonicalize
name                                             old time/op    new time/op    delta
IsoCanonicalHashes/test019-in.nq/decomp=false-8    27.6µs ± 6%    26.4µs ± 5%  -4.08%  (p=0.000 n=46+48)
IsoCanonicalHashes/test019-in.nq/decomp=true-8     29.9µs ± 5%    29.6µs ± 3%  -1.12%  (p=0.000 n=45+49)
IsoCanonicalHashes/test044-in.nq/decomp=false-8     449ms ± 3%     432ms ± 1%  -3.84%  (p=0.000 n=45+47)
IsoCanonicalHashes/test044-in.nq/decomp=true-8      462ms ± 1%     452ms ± 4%  -2.13%  (p=0.000 n=44+43)

name                                             old alloc/op   new alloc/op   delta
IsoCanonicalHashes/test019-in.nq/decomp=false-8    16.1kB ± 0%    16.5kB ± 0%  +2.39%  (p=0.000 n=50+50)
IsoCanonicalHashes/test019-in.nq/decomp=true-8     18.9kB ± 0%    19.5kB ± 0%  +2.79%  (p=0.000 n=50+50)
IsoCanonicalHashes/test044-in.nq/decomp=false-8    85.4MB ± 0%    82.1MB ± 0%  -3.93%  (p=0.000 n=49+50)
IsoCanonicalHashes/test044-in.nq/decomp=true-8     84.7MB ± 0%    81.3MB ± 0%  -3.97%  (p=0.000 n=48+50)

name                                             old allocs/op  new allocs/op  delta
IsoCanonicalHashes/test019-in.nq/decomp=false-8       207 ± 0%       215 ± 0%  +3.86%  (p=0.000 n=50+50)
IsoCanonicalHashes/test019-in.nq/decomp=true-8        238 ± 0%       249 ± 0%  +4.62%  (p=0.000 n=50+50)
IsoCanonicalHashes/test044-in.nq/decomp=false-8     1.53M ± 0%     1.51M ± 0%  -1.03%  (p=0.000 n=49+50)
IsoCanonicalHashes/test044-in.nq/decomp=true-8      1.52M ± 0%     1.51M ± 0%  -1.04%  (p=0.000 n=49+50)
2021-05-05 14:52:27 +09:30
Dan Kortschak
782095d131 graph/formats/rdf: implement canonicalisation hashing
Test cases test001-in.nq to test062-in.nq are from [1] licensed under the
W3C BSD 3-clause license. Test cases hogan*.nq are from the original paper
used with permission.

[1]https://json-ld.github.io/normalization/tests/index.html
2021-05-05 14:52:27 +09:30
Dan Kortschak
d39af6a71b graph/formats/rdf: new package for RDF N-Quad parsing
This code is based on the RDF N-Quad parsing code that I wrote for the Cayley
graph database project in 2014. The code here does not include any code that
was written by other members of the Cayley project and so is unencumbered by
copyright ownership from that project.

License addition is for the test suite from [1] linked from [2]. A second more
restrictive license is possible if we are claiming spec compliance[3].

[1]https://www.w3.org/Consortium/Legal/2008/03-bsd-license
[2]https://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
[3]https://www.w3.org/Consortium/Legal/2008/04-testsuite-license.html
2021-01-13 20:31:06 +10:30