Mercurial > code > home > repos > light9
changeset 473:9ed6c40b3d6a
new subterms get a good uri and label
Ignore-this: 403562516ef35e4a3b6d3fe2bbd401b2
author | drewp@bigasterisk.com |
---|---|
date | Fri, 12 Jun 2009 08:53:36 +0000 |
parents | 2442b086e4bb |
children | c4807e96ee90 |
files | bin/curvecalc |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/curvecalc Fri Jun 12 07:21:42 2009 +0000 +++ b/bin/curvecalc Fri Jun 12 08:53:36 2009 +0000 @@ -20,7 +20,7 @@ from twisted.internet import reactor,tksupport import twisted from twisted.web.xmlrpc import Proxy -from rdflib import Literal, URIRef, RDF +from rdflib import Literal, URIRef, RDF, RDFS from rdflib.Graph import Graph import rdflib import logging @@ -328,7 +328,10 @@ newname = tk.StringVar() def add_cmd(evt): - add_one_subterm(graph, L9['sub/%s' % newname.get()], + uri = L9['sub/%s' % newname.get()] + graph.add((uri, RDF.type, L9.Subterm)) + graph.add((uri, RDFS.label, Literal(newname.get()))) + add_one_subterm(graph, uri, curveset, subterms, root, ssv, None) if evt.state & 4: # control key modifier curveset.new_curve(newname.get()) @@ -361,6 +364,7 @@ uri = URIRef(song + "/subterm/" + subterm.submaster.name) graph.add((song, L9['subterm'], uri)) graph.add((uri, RDF.type, L9['Subterm'])) + graph.add((uri, RDFS.label, Literal(subterm.submaster.name))) graph.add((uri, L9['sub'], L9['sub/%s' % subterm.submaster.name])) graph.add((uri, L9['expression'], Literal(subterm.subexpr.expr))) return graph