diff options
author | amita singh <amitacr@gmail.com> | 2012-06-01 12:44:17 +0530 |
---|---|---|
committer | amita singh <amitacr@gmail.com> | 2012-06-01 12:44:17 +0530 |
commit | dade877e7f3982ac949564271037d730d6284d35 (patch) | |
tree | ba59e329dcab6f6dfffb542c2394e224b32d5b90 /gstudio/management/commands | |
parent | 79cc4dd9f37a45b40ba62249a14fde7f4b3b09fe (diff) | |
download | gnowsys-dade877e7f3982ac949564271037d730d6284d35.tar.gz |
gstudio_rdffile_path added in settings.py
Diffstat (limited to 'gstudio/management/commands')
-rw-r--r-- | gstudio/management/commands/dump_all_rdf.py | 16 | ||||
-rw-r--r-- | gstudio/management/commands/generate_all_rdf.py | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/gstudio/management/commands/dump_all_rdf.py b/gstudio/management/commands/dump_all_rdf.py index dffcd70..c2d21b7 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. - - diff --git a/gstudio/management/commands/generate_all_rdf.py b/gstudio/management/commands/generate_all_rdf.py index bc57286..a504a00 100644 --- a/gstudio/management/commands/generate_all_rdf.py +++ b/gstudio/management/commands/generate_all_rdf.py @@ -168,7 +168,7 @@ def link(node): class Command(BaseCommand): def handle(self,*args,**options): - # verify the type of the node and pass the node to display the rdf accordingly. + # verifies and pass the node rdf_discription() to display the rdf accordingly. inr=0 |