Example #1
0
func (arg *Arg) ToRDF(graph *argo.Graph) (term argo.Term) {
	term = str2term(arg.URI)
	graph.AddTriple(term, argo.A, LOOP.Get("Argument"))

	if arg.Type != nil {
		graph.AddTriple(term, LOOP.Get("restrictType"), arg.Type.ToRDF(graph))
	}

	if arg.Label != "" {
		graph.AddTriple(term, argo.RDFS.Get("label"), argo.NewLiteral(arg.Label))
	}

	return term
}
Example #2
0
func (expr StringConstant) ToRDF(graph *argo.Graph) (term argo.Term) {
	return argo.NewLiteral(string(expr))
}