Commit Graph

56 Commits

Author SHA1 Message Date
Jes Cok
bd727a9e14 all: fix typos 2023-07-16 13:37:17 +09:30
Dan Kortschak
258a51e069 graph/formats/dot/internal: regenerate with latest goccmack/gocc
Make use of go.mod to pin gocc version and go mod tidy.
2023-05-01 06:18:27 +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
d8ad7756b6 all: fix spelling and typos 2022-03-14 21:32:06 +10: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
ccc0da248a all: run make builds pass with go master
Run gofmt go1.17 adds the new //go:build comments
2021-04-19 15:00:56 +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
Dan Kortschak
b34a300801 all: fix capitalisation of Gonum
This fixes the capitalisation of Gonum where it refers to the project rather
than the GitHub organisation or repository. The text of CONTRIBUTORS also
is fixed to reflect the reality that contributors may have contributed to
other repositories within the project.
2019-11-16 21:25:28 +10:30
Dan Kortschak
6747f05f2d graph/formats/dot,travis: update gocc version 2019-03-12 06:16:55 +10:30
Dan Kortschak
3b3c374240 graph/formats/dot/fuzz: add fuzzer function and corpus
The fuzz corpus was seeded with a small number of hand crafted examples
and occasionally augmented manually by identifying code paths that were
not touched and adding text to target those. Then iterating.
2019-03-07 19:50:19 +10:30
Dan Kortschak
75c68f713c graph/formats/dot/internal: add tests for a fuzz data corpus 2019-03-07 19:50:19 +10:30
Dan Kortschak
6df7f4be3a graph/formats/dot/testdata: don't clone the full history 2019-03-06 21:21:16 +10:30
Dan Kortschak
eb0539d9f4 graph/formats/gexf12: check error 2019-01-27 21:39:27 +10:30
Dan Kortschak
45a3ddb340 cytoscapejs: fix optional field marshaling and helper type naming 2018-10-26 23:42:21 +10:30
Dan Kortschak
f0982070f5 graph/formats: add packages for serialising graphs to js rendering engines 2018-10-20 06:39:27 +10:30
Dan Kortschak
056846ef7e gexf12: make slice fields plural and break words apart 2018-10-13 18:53:13 +10:30
Dan Kortschak
406984d374 gexf12: do not use pointers on simple types 2018-10-13 06:13:25 +10:30
Dan Kortschak
59eac3d17e gexf12: fix omitable and unbounded attributes 2018-10-13 06:13:25 +10:30
Dan Kortschak
f48f3e4ab3 graph/formats/gexf12: new package for handling GEXF1.2 graph description files
This was largely written by aqwari.net/xml/cmd/xsdgen working on the XSD
files available from the gephy/gexf specs repository[1], with some help;
the specs use includes which cause xsdgen to fail, so I manually
in-lined the includes.

The generated code was then edited to make optional attributes exist on
pointers, to reduce the length of labels to within reasonably normal Go
idiom and removing unnecessary namespacing.

The package is versioned since the format appears to arbitrarily be
updated.

[1]81ba4e7ccd/specs/1.2draft
2018-10-11 16:48:29 +10:30
Dan Kortschak
36be7e6faa travis: check for copyright headers 2018-09-05 16:54:43 +09:30
Dan Kortschak
9b6dcf36f0 all: fix up missing or malformatted package doc comments 2018-06-07 19:37:48 +09:30
Egon Elbre
51a14e5e72 graph/formats/dot: allow unicode inside html 2018-06-03 22:10:54 +09:30
J. Holmes
cb2511e4c8 encoding/dot: support edge ports on Unmarshal/decode 2018-04-16 14:31:32 +09:30
kortschak
805531d142 all: change capitalization of gonum in license header 2017-11-02 06:54:08 +10:30
mewmew
7e53ef2fae all: use fixdocs tool to store package documentation in doc.go
Add copyright header to doc.go

Keep original comment style (e.g. line comments and block comments).

Fix doc comments containing multiple line comments.

Remove vanity imports from all files except doc.go.

Fixes #12.

The source code of fixdocs is located at:
https://play.golang.org/p/7RtYLzldsO
2017-08-16 14:26:00 +02:00
mewmew
ac48587c92 Revert "all: use fixdocs tool to store package documentation in doc.go"
This reverts commit b2982a3e50.
2017-08-16 14:21:05 +02:00
mewmew
b2982a3e50 all: use fixdocs tool to store package documentation in doc.go
Add copyright header to doc.go

Keep original comment style (e.g. line comments and block comments).

Fix doc comments containing multiple line comments.
2017-08-16 14:07:36 +02:00
mewmew
5b4711aa15 Revert "all: use fixdocs tool to store package documentation in doc.go"
This reverts commit b0a98102dc.
2017-08-16 14:07:17 +02:00
mewmew
b0a98102dc all: use fixdocs tool to store package documentation in doc.go
Add copyright header to doc.go

Keep original comment style (e.g. line comments and block comments).
2017-08-16 14:02:26 +02:00
mewmew
7eaea7c428 Revert "all: use fixdocs tool to store package documentation in doc.go"
This reverts commit 00292b2d57.
2017-08-16 14:01:36 +02:00
mewmew
00292b2d57 all: use fixdocs tool to store package documentation in doc.go
Add copyright header to doc.go
2017-08-16 13:56:50 +02:00
mewmew
a37fef5a6d Revert "all: use fixdocs tool to store package documentation in doc.go"
This reverts commit 963877e5f5.
2017-08-16 13:54:16 +02:00
mewmew
963877e5f5 all: use fixdocs tool to store package documentation in doc.go 2017-08-16 13:19:00 +02:00
kortschak
159a37d657 graph/formats/dot/internal: update gocc version to cfc6e12 2017-08-16 19:16:28 +09:30
mewmew
4e95d5c920 graph/formats/dot: simplify parser generator Makefile
Gocc now generated output which conforms to gofmt
(goccmack/gocc#36 has been resolved).

Simplify the Makefile by removing the goimports invokation.
2017-07-24 20:54:05 +09:30