Skip to content

Commit c3d3cf5

Browse files
committed
linkedql: Replace AbsoluteIRI with iri.FullWith(ns)
1 parent e16ceab commit c3d3cf5

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

query/linkedql/entity_identfier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type EntityIRI quad.IRI
1414

1515
// BuildIdentifier implements EntityIdentifier
1616
func (i EntityIRI) BuildIdentifier(ns *voc.Namespaces) (quad.Value, error) {
17-
return AbsoluteIRI(quad.IRI(i), ns), nil
17+
return quad.IRI(i).FullWith(ns), nil
1818
}
1919

2020
// EntityBNode is an entity BNode.

query/linkedql/property_path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (p PropertyIRIStrings) BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*
9090
type PropertyIRI quad.IRI
9191

9292
func (p PropertyIRI) full(ns *voc.Namespaces) quad.IRI {
93-
return AbsoluteIRI(quad.IRI(p), ns)
93+
return quad.IRI(p).FullWith(ns)
9494
}
9595

9696
// BuildPath implements PropertyPath

query/linkedql/steps/properties.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (s *Properties) BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*path.Pa
4343
p := fromPath
4444
if s.Names != nil {
4545
for _, name := range s.Names {
46-
name = linkedql.AbsoluteIRI(name, ns)
46+
name = name.FullWith(ns)
4747
tag := string(name)
4848
p = p.Save(name, tag)
4949
}

query/linkedql/steps/reverse_properties.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (s *ReverseProperties) BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*
4141
}
4242
p := fromPath
4343
for _, name := range s.Names {
44-
name = linkedql.AbsoluteIRI(name, ns)
44+
name = name.FullWith(ns)
4545
tag := string(name)
4646
p = fromPath.SaveReverse(name, tag)
4747
}

query/linkedql/voc_util.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,13 @@ import (
55
"github.com/cayleygraph/quad/voc"
66
)
77

8-
// AbsoluteIRI uses given ns to resolve short IRIs to their full form
9-
func AbsoluteIRI(iri quad.IRI, ns *voc.Namespaces) quad.IRI {
10-
return quad.IRI(ns.FullIRI(string(iri)))
11-
}
12-
138
// AbsoluteValue uses given ns to resolve short IRIs and types in typed strings to their full form
149
func AbsoluteValue(value quad.Value, ns *voc.Namespaces) quad.Value {
1510
switch v := value.(type) {
1611
case quad.IRI:
17-
return AbsoluteIRI(v, ns)
12+
return v.FullWith(ns)
1813
case quad.TypedString:
19-
return quad.TypedString{Value: v.Value, Type: AbsoluteIRI(v.Type, ns)}
14+
return quad.TypedString{Value: v.Value, Type: v.Type.FullWith(ns)}
2015
default:
2116
return v
2217
}

0 commit comments

Comments
 (0)