summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpukkamustard <pukkamustard@posteo.net>2020-09-08 16:06:55 +0200
committerpukkamustard <pukkamustard@posteo.net>2020-09-08 16:22:28 +0200
commitcd23a1cb99bb141f015194ec7f4c0dca1ba683cf (patch)
treed2f483bbcb3c3464ca23f99085b82901c7a42961
parentc01f4c3cbe60379a5f3e33c768e45e6198427dc1 (diff)
(schemantic fragment-graph): Fix graph-query methods
-rw-r--r--schemantic/fragment-graph.scm16
1 files changed, 11 insertions, 5 deletions
diff --git a/schemantic/fragment-graph.scm b/schemantic/fragment-graph.scm
index 3a1a528..e60ea9e 100644
--- a/schemantic/fragment-graph.scm
+++ b/schemantic/fragment-graph.scm
@@ -177,17 +177,23 @@
(term->fragment-reference base-subject p)
(term->fragment-reference base-subject o)))))))))
+;; Helpers to build graph-queries on fragment graph
+;;
+;; If given an <iri> to build initial graph-query, it is assumed that the query
+;; should be done for the base subject.
+;;
+;; Only if a <fragment-reference> is given as initial argument it will be put in
+;; subject position.
+
(define-method (graph-query (fg <fragment-graph>) (s <iri>))
(make <graph-query>
- #:graph fg #:s (term->fragment-reference (fragment-graph-base-subject fg) s)))
+ #:graph fg
+ #:s (make-fragment-reference #f)
+ #:p (term->fragment-reference (fragment-graph-base-subject fg) s)))
(define-method (graph-query (fg <fragment-graph>) (fr <fragment-reference>))
(make <graph-query> #:graph fg #:s fr))
-(define-method (graph-query (fg <fragment-graph>) (s <string>))
- (make <graph-query> #:graph fg #:s (make-fragment-reference s)))
-
-
;; CSexp encoding
(define (term->csexp term)