summaryrefslogtreecommitdiff
path: root/schemantic/blank-node.scm
diff options
context:
space:
mode:
Diffstat (limited to 'schemantic/blank-node.scm')
-rw-r--r--schemantic/blank-node.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/schemantic/blank-node.scm b/schemantic/blank-node.scm
new file mode 100644
index 0000000..71d5f5c
--- /dev/null
+++ b/schemantic/blank-node.scm
@@ -0,0 +1,23 @@
+; SPDX-FileCopyrightText: 2020 pukkamustard <pukkamustard@posteo.net>
+;
+; SPDX-License-Identifier: GPL-3.0-or-later
+
+(define-module (schemantic blank-node)
+ #:use-module (schemantic iri)
+
+ #:use-module (oop goops)
+
+ #:export (<blank-node>
+ make-blank-node))
+
+(define-class <blank-node> (<term>)
+ (value #:init-keyword #:value #:getter blank-node-value))
+
+(define-method (equal? (x <blank-node>) (y <blank-node>))
+ (equal? (iri-value x) (iri-value y)))
+
+(define-method (write (self <blank-node>) port)
+ (format port "<blank-node ~a>" (blank-node-value self)))
+
+(define (make-blank-node value)
+ (make <blank-node> #:value value))