summaryrefslogtreecommitdiff
path: root/gstudio/management/commands/dump_all_rdf.py
diff options
context:
space:
mode:
authoramita singh <amitacr@gmail.com>2012-06-01 12:44:17 +0530
committeramita singh <amitacr@gmail.com>2012-06-01 12:44:17 +0530
commitdade877e7f3982ac949564271037d730d6284d35 (patch)
treeba59e329dcab6f6dfffb542c2394e224b32d5b90 /gstudio/management/commands/dump_all_rdf.py
parent79cc4dd9f37a45b40ba62249a14fde7f4b3b09fe (diff)
downloadgnowsys-dade877e7f3982ac949564271037d730d6284d35.tar.gz
gstudio_rdffile_path added in settings.py
Diffstat (limited to 'gstudio/management/commands/dump_all_rdf.py')
-rw-r--r--gstudio/management/commands/dump_all_rdf.py16
1 files changed, 8 insertions, 8 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.
-
-