Commit 08e9211f authored by Thodoris Nestoridis's avatar Thodoris Nestoridis

access to api (semantic analysis, property list)

parent 9f2ebd86
......@@ -88,7 +88,7 @@ def create_infer_result(instance, destination):
def initialize_instances(instance):
try :
g = Graph()
file_name = instance.title_bgroup.replace('/', '')
file_name = instance.title_bgroup.replace('/', '').replace(' ', '_')
save_path = "../../Ontologies/"+file_name+"/"
if (os.path.exists("../../Ontologies/"+file_name+"/") == False):
os.mkdir("../../Ontologies/"+file_name)
......
......@@ -80,6 +80,11 @@ class BoilerplateGroupDetailsAPIView(RetrieveUpdateDestroyAPIView):
serializer_class = BoilerplateGroupSerializer
queryset = BoilerplateGroup.objects.all()
def get_queryset(self):
group_pk = self.kwargs['pk']
queryset_infer = BoilerplateGroup.objects.filter(id = group_pk)
return queryset_infer
#Custom actions when PUT
def perform_update(self, serializer):
instance = serializer.save()
......@@ -177,6 +182,7 @@ class PrefixListAPIView(ListAPIView):
class ExtractedPropertyAPIView(APIView):
def get(self, request, groupboil, boilerplate, format=None):
return Response(getExtractedProperty(boilerplate))
......@@ -279,11 +285,14 @@ class PropertyListAPIView(APIView):
"""
API view to retrieve property file
"""
permission_classes = [permissions.IsAuthenticatedOrReadOnly]
serializer_class = BoilerplateDataSerializer
def get(self, request, groupboil, format=None):
group_gb = groupboil
queryset_boil_data = BoilerplateData.objects.filter(owner_data = self.request.user, group_of_boilerplate_data = group_gb)
#queryset_boil_data = BoilerplateData.objects.filter(owner_data = self.request.user, group_of_boilerplate_data = group_gb)
queryset_boil_data = BoilerplateData.objects.filter(group_of_boilerplate_data = group_gb)
#temp_file = NamedTemporaryFile(delete=False)
a =list(queryset_boil_data.values())
with tempfile.NamedTemporaryFile(mode='w+t', delete=False) as f:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment