-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbitstomach.py
More file actions
53 lines (47 loc) · 1.32 KB
/
bitstomach.py
File metadata and controls
53 lines (47 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import warnings
import time
import logging
import sys
import warnings
import time
import logging
import json
import re
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from rdflib import Graph, Literal, Namespace, URIRef,BNode
from rdflib.collection import Collection
from rdflib.namespace import FOAF, RDF, RDFS, SKOS, XSD
from rdflib.serializer import Serializer
from rdfpandas.graph import to_dataframe
from SPARQLWrapper import XML, SPARQLWrapper
#from calc_gaps_slopes import gap_calc,trend_calc,monotonic_pred,mod_collector
#from insert_annotate import insert_annotate
from prepare_data_annotate import Prepare_data_annotate
from bit_stomach import Bit_stomach
warnings.filterwarnings("ignore")
measure_dicts={}
social_dicts={}
goal_dicts={}
social_comparison_dicts={}
goal_comparison_dicts={}
def read(file):
#start_time = time.time()
g = Graph()
g.parse(data=file,format="json-ld")
#logging.critical(" reading graph--- %s seconds ---" % (time.time() - start_time))
return g
f=open(sys.argv[1])
performance_data_df = pd.read_csv(sys.argv[2])
spek_cs = json.load(f)
#print(type(content))
spek_cs =json.dumps(spek_cs)
a=read(spek_cs)
bs=Bit_stomach(a,performance_data_df)
BS=bs.annotate()
op=a.serialize(format='json-ld', indent=4)
#print(op)
f = open("spek_cs.json", "w")
f.write(op)
f.close()