From dade877e7f3982ac949564271037d730d6284d35 Mon Sep 17 00:00:00 2001 From: amita singh Date: Fri, 1 Jun 2012 12:44:17 +0530 Subject: gstudio_rdffile_path added in settings.py --- gstudio/management/commands/dump_all_rdf.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'gstudio/management/commands/dump_all_rdf.py') diff --git a/gstudio/management/commands/dump_all_rdf.py b/gstudio/management/commands/dump_all_rdf.py index dffcd70e..c2d21b79 100644 --- a/gstudio/management/commands/dump_all_rdf.py +++ b/gstudio/management/commands/dump_all_rdf.py @@ -9,6 +9,8 @@ from rdflib.term import URIRef from tempfile import mkdtemp from gstudio.models import * from objectapp.models import * +import settings +import os.path from django.core.management.base import NoArgsCommand from django.core.management.base import BaseCommand @@ -19,7 +21,7 @@ def rdf_all(notation='xml'): """ valid_formats = ["xml", "n3", "ntriples", "trix"] default_graph_uri = "http://gstudio.gnowledge.org/rdfstore" - # default_graph_uri = "http://example.com/" + configString = "/var/tmp/rdfstore" # Get the IOMemory plugin. @@ -40,8 +42,7 @@ def rdf_all(notation='xml'): # Now we'll add some triples to the graph & commit the changes - #rdflib = Namespace('http://sbox.gnowledge.org/gstudio/') - rdflib = Namespace('http://example.com/') + graph.bind("gstudio", "http://gnowledge.org/") exclusion_fields = ["id", "rght", "node_ptr_id", "image", "lft", "_state", "_altnames_cache", "_tags_cache", "nid_ptr_id", "_mptt_cached_fields"] @@ -133,8 +134,10 @@ def rdf_all(notation='xml'): graph.add((rdflib[subject], rdflib[predicate], Literal(pobject))) rdf_code=graph.serialize(format=notation) - - temp_path = '/home/labadmin/dev/gnowsys-studio/demo/newfiles/' + 'rdfdata'+'.rdf' + #path to store the rdf in a file + + x = os.path.join(os.path.dirname(__file__), 'rdffiles.rdf') + temp_path=str(x) file = open(temp_path, 'w') file.write(rdf_code) file.close() @@ -159,9 +162,6 @@ def link(node): return rdflib -#makes individual rdf file for nodes. - - -- cgit v1.2.3-70-g09d2