Skip to content

Commit

Permalink
Merge pull request #11 from codinuum/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
codinuum authored Oct 14, 2021
2 parents 8f86e3c + 07d6b94 commit c22bbe5
Show file tree
Hide file tree
Showing 76 changed files with 7,804 additions and 3,128 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN set -x && \
git clone https://github.com/openlink/virtuoso-opensource && \
cd virtuoso-opensource && \
./autogen.sh && \
env CFLAGS='-O2 -m64' ./configure --prefix=/opt/virtuoso --with-layout=opt --with-readline=/usr \
env CFLAGS='-O2' ./configure --prefix=/opt/virtuoso --with-layout=opt --with-readline=/usr \
--program-transform-name="s/isql/isql-v/" --disable-dbpedia-vad --disable-demo-vad \
--enable-fct-vad --enable-ods-vad --disable-sparqldemo-vad --disable-tutorial-vad \
--enable-isparql-vad --enable-rdfmappers-vad && \
Expand Down
2 changes: 1 addition & 1 deletion diffviewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "Masatomo Hashimoto",
"license": "Apache 2.0",
"devDependencies": {
"electron": "^10.1.3",
"electron": ">=11.5.0",
"electron-packager": "^15.1.0"
},
"dependencies": {
Expand Down
10 changes: 7 additions & 3 deletions python/src/cca/ccautil/diffts.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ def do_cmd(cmd):
stat = proc.system(cmd)
if stat == 0:
break

time.sleep(1)
logger.info('retrying...({}) cmd="{}"'.format(i, cmd))


#####

Expand Down Expand Up @@ -396,7 +396,9 @@ def diffts(diff_cmd, file1, file2,
fact_encoding=Enc.FDLCO,
fact_hash_algo=HashAlgo.MD5,
dumpccs=False,
dironly=False, check=False,
dironly=False,
check=False,
aggressive=False,
keep_filtered_temp=False,
local_cache_name='',
dump_delta=False,
Expand Down Expand Up @@ -492,6 +494,8 @@ def diffts(diff_cmd, file1, file2,
check_opt = ' -check'

other_opts = ''
if aggressive:
other_opts += ' -aggressive'
if keep_filtered_temp:
logger.info('keep filtered temp files')
other_opts += ' -keep-filtered-temp-file'
Expand Down
40 changes: 29 additions & 11 deletions python/src/cca/ccautil/find_change_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def jsondumps(obj):

HTML_HEAD = '''<html>
<head><title>%(proj_id)s</title>
<link rel="stylesheet" type="text/css" href="../demo.css"/>
<link rel="stylesheet" type="text/css" href="%(url_base_path)s/demo.css"/>
</head>
<body>
Expand Down Expand Up @@ -135,7 +135,7 @@ def jsondumps(obj):

FRAME_PAGE = '''<html>
<head><title>%(proj_id)s</title>
<link rel="stylesheet" type="text/css" href="../demo.css"/>
<link rel="stylesheet" type="text/css" href="%(url_base_path)s/demo.css"/>
</head>
<body>
<h1>%(proj_id)s</h1>
Expand All @@ -161,7 +161,7 @@ def jsondumps(obj):
<table class="noframe" border="0" cellspacing="0" cellpadding="0"><tr><td>
<span class="variable">%(var0)s</span> -> <span class="variable">%(var1)s</span> (%(startl0)dL,%(startc0)dC - %(startl1)dL,%(startc1)dC)
</td><td>
<form id="%(form_id)s" method="POST" action="../cgi-bin/openviewer" target="_blank">
<form id="%(form_id)s" method="POST" action="%(url_base_path)s/cgi-bin/openviewer" target="_blank">
<input type="hidden" name="proj_id" value="%(proj_id)s">
<input type="hidden" name="hash_algo" value="%(algo)s">
<input type="hidden" name="ver0" value="%(ver0)s">
Expand Down Expand Up @@ -973,7 +973,7 @@ def _show_stat(self, f, count_tbl, cov):
f.write('</table>\n')


def make_applet_html(self, vpid, form_id, var0, var1, ent0, ent1, ver0, ver1, desc='{}', ess0='[]', ess1='[]', ess01='[]'):
def make_applet_html(self, vpid, form_id, var0, var1, ent0, ent1, ver0, ver1, desc='{}', ess0='[]', ess1='[]', ess01='[]', url_base_path='..'):
fid0 = ent0.get_file_id()
fid1 = ent1.get_file_id()

Expand Down Expand Up @@ -1008,6 +1008,7 @@ def make_applet_html(self, vpid, form_id, var0, var1, ent0, ent1, ver0, ver1, de
'src1' : url1,
'vpid' : vpid,
'form_id' : form_id,
'url_base_path' : url_base_path,
}

r0 = ent0.get_range()
Expand Down Expand Up @@ -1158,7 +1159,7 @@ def reduce_chgs(self, chgs):



def dump(self, outdir, foutdir=None):
def dump(self, outdir, foutdir=None, url_base_path='..'):

if not os.path.exists(outdir):
logger.warning('creating "%s"...' % outdir)
Expand Down Expand Up @@ -1209,7 +1210,7 @@ def dump(self, outdir, foutdir=None):
for change_pat in r_tbl.keys():
count_tbl[change_pat] = count_tbl.get(change_pat, 0) + len(r_tbl[change_pat])

html_head = HTML_HEAD % {'proj_id': self._proj_id }
html_head = HTML_HEAD % {'proj_id':self._proj_id,'url_base_path':url_base_path}

f_summary.write(html_head)

Expand All @@ -1231,6 +1232,11 @@ def dump(self, outdir, foutdir=None):
first_path_sub = None

for lang in self._result.keys():
try:
xkey_tbl_lang = xkey_tbl[lang]
except KeyError:
xkey_tbl_lang = {}
xkey_tbl[lang] = xkey_tbl_lang

ver_tbl = self._result[lang]
ver_pairs = list(ver_tbl.keys())
Expand All @@ -1250,6 +1256,14 @@ def dump(self, outdir, foutdir=None):
lver0 = get_localname(ver0)
lver1 = get_localname(ver1)

lvp = f'{lver0}:{lver1}'
local_count = 0
try:
xkey_tbl_lang_vp = xkey_tbl_lang[lvp]
except KeyError:
xkey_tbl_lang_vp = {}
xkey_tbl_lang[lvp] = xkey_tbl_lang_vp

path_sub = os.path.join(html_dir, '%d.html' % ver_pair_count)

vpid = str(ver_pair_count)
Expand Down Expand Up @@ -1400,6 +1414,7 @@ def dump(self, outdir, foutdir=None):
'desc' : '{}',
'ess0' : '[]',
'ess1' : '[]',
'url_base_path' : url_base_path,
}
item_data = {}

Expand All @@ -1422,11 +1437,12 @@ def dump(self, outdir, foutdir=None):
others_tbl = self.get_others(change_pat, ent0, ent1)

count += 1
local_count += 1

ln0 = get_localname(str(ent0.get_uri()))
ln1 = get_localname(str(ent1.get_uri()))
xkey = '%s:%s:%s' % (change_pat, ln0, ln1)
xkey_tbl[xkey] = count
xkey_tbl_lang_vp[xkey] = local_count

### BEGIN EXTRACT FACT
chgpat_node = None
Expand Down Expand Up @@ -1599,7 +1615,7 @@ def finish_ess_tbl(tbl):

form_id = '%d-%d' % (count, sub_count)

a = self.make_applet_html(vpid, form_id, v0, v1, e0, e1, ver0, ver1, desc_str, ess0_str, ess1_str, ess01_str)
a = self.make_applet_html(vpid, form_id, v0, v1, e0, e1, ver0, ver1, desc_str, ess0_str, ess1_str, ess01_str, url_base_path)

if a:
aps.append(a)
Expand Down Expand Up @@ -1694,6 +1710,7 @@ def finish_ess_tbl(tbl):
'summary' : summary,
'first' : first,
'year' : datetime.today().year,
'url_base_path' : url_base_path,
})

f.close()
Expand All @@ -1718,7 +1735,8 @@ def finish_ess_tbl(tbl):
##

with open(os.path.join(outdir, self._proj_id+'.json'), 'w') as f:
json.dump(xkey_tbl, f)
tbl = {self._proj_id : xkey_tbl}
json.dump(tbl, f)



Expand Down Expand Up @@ -2463,7 +2481,7 @@ def get_elems(i):

def find(query_dir, queries, predicate_tbl, extra_fact_extractor,
base_dir, proj_id, foutdir, outdir, pw, port,
limit, lang, method, change_enumeration, per_ver, query_prec, conf=None):
limit, lang, method, change_enumeration, per_ver, query_prec, conf=None, url_base_path='..'):

finder = Finder(query_dir, queries, base_dir, proj_id,
predicate_tbl=predicate_tbl, limit=limit, lang=lang,
Expand All @@ -2479,7 +2497,7 @@ def find(query_dir, queries, predicate_tbl, extra_fact_extractor,
if fact_outdir == DEFAULT_FACT_OUTPUT_DIR:
fact_outdir = fact_outdir.replace('<PROJ_ID>', proj_id)

finder.dump(outdir, fact_outdir)
finder.dump(outdir, fact_outdir, url_base_path=url_base_path)


def main(query_dir, queries, desc, predicate_tbl=None, extra_fact_extractor=None):
Expand Down
Loading

0 comments on commit c22bbe5

Please sign in to comment.