Git Product home page Git Product logo

knowledge_linker's People

Contributors

glciampaglia avatar okdistribute avatar shiralkarprashant avatar zoher15 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

knowledge_linker's Issues

2 Failures & 1 Error occurring while running "python setup.py nosetests"

I'm getting the following error & failures while trying to run the test cases


ERROR: Test 'backbone' metric againt NetworkX (Rion's testing)

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/knowledge_linker/knowledge_linker/tests/test_closure.py", line 422, in test_backbone_metric
DG.add_edge(n1, n2, {'weight_sum':sum_path_weights})
TypeError: add_edge() takes exactly 3 arguments (4 given)


FAIL: Doctest: knowledge_linker.algorithms.closure.closuress

Traceback (most recent call last):
File "/usr/lib/python2.7/doctest.py", line 2226, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for knowledge_linker.algorithms.closure.closuress
File "/knowledge_linker/knowledge_linker/algorithms/closure.py", line 114, in closuress


FAIL: closure on E-R random graph.

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/knowledge_linker/knowledge_linker/tests/test_closure.py", line 95, in test_closure_rand
assert np.all(p1 == p2)
AssertionError


REPORT FILE:
https://openload.co/f/dCKlFZq9X6g/docker_kl_report1.txt

Incomplete package list in setup.py causes ImportError in klinker

After installing the package

python setup.py install

Trying to run klinker will throw:

Traceback (most recent call last):
  File "/home/marvram/anaconda3/envs/p2/bin/klinker", line 11, in <module>
    load_entry_point('knowledge-linker==0.1rc0', 'console_scripts', 'klinker')()
  File "/home/marvram/anaconda3/envs/p2/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg/pkg_resources/__init__.py", line 565, in load_entry_point
  File "/home/marvram/anaconda3/envs/p2/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg/pkg_resources/__init__.py", line 2598, in load_entry_point
  File "/home/marvram/anaconda3/envs/p2/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg/pkg_resources/__init__.py", line 2258, in load
  File "/home/marvram/anaconda3/envs/p2/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg/pkg_resources/__init__.py", line 2264, in resolve
  File "build/bdist.linux-x86_64/egg/knowledge_linker/__init__.py", line 31, in <module>
ImportError: cannot import name io

This is because setup.py only specifies packages=['knowledge_linker'], while it should do packages=find_packages().

Numpy and Pandas

(env-kl) [zkachwal@h2 knowledge_linker]$ pip install .
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Processing /gpfs/home/z/k/zkachwal/Carbonate/knowledge_linker
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-QW1JDC/setup.py", line 20, in <module>
        from numpy import get_include
    ImportError: No module named numpy
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-QW1JDC/

Fixed by installing numpy.

After installing:

(env-kl) [zkachwal@h2 knowledge_linker]$ klinker -h
Traceback (most recent call last):
  File "/N/u/zkachwal/Carbonate/miniconda3/envs/env-kl/bin/klinker", line 6, in <module>
    from knowledge_linker.frontend.cmdline import main
  File "/N/u/zkachwal/Carbonate/miniconda3/envs/env-kl/lib/python2.7/site-packages/knowledge_linker/frontend/cmdline.py", line 20, in <module>
    from . import linkpred
  File "/N/u/zkachwal/Carbonate/miniconda3/envs/env-kl/lib/python2.7/site-packages/knowledge_linker/frontend/linkpred.py", line 22, in <module>
    import pandas as pd
ImportError: No module named pandas

error: command 'gcc' failed with exit status 1

(env-factcheckgraph) [zkachwal@burns knowledge_linker]$ python --version
Python 3.6.8 :: Anaconda, Inc.
(env-factcheckgraph) [zkachwal@burns knowledge_linker]$ python setup.py install
running install
running bdist_egg
running egg_info
writing knowledge_linker.egg-info/PKG-INFO
writing dependency_links to knowledge_linker.egg-info/dependency_links.txt
writing entry points to knowledge_linker.egg-info/entry_points.txt
writing requirements to knowledge_linker.egg-info/requires.txt
writing top-level names to knowledge_linker.egg-info/top_level.txt
reading manifest file 'knowledge_linker.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'LICENSE.txt'
writing manifest file 'knowledge_linker.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'knowledge_linker.algorithms.heap' extension
gcc -pthread -B /l/cnets/research/factcheckgraph/env-factcheckgraph/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/l/cnets/research/factcheckgraph/miniconda3/envs/env-factcheckgraph/lib/python3.6/site-packages/numpy/core/include -I/l/cnets/research/factcheckgraph/miniconda3/envs/env-factcheckgraph/include/python3.6m -c knowledge_linker/algorithms/heap.c -o build/temp.linux-x86_64-3.6/knowledge_linker/algorithms/heap.o
In file included from /l/cnets/research/factcheckgraph/miniconda3/envs/env-factcheckgraph/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1824,
                 from /l/cnets/research/factcheckgraph/miniconda3/envs/env-factcheckgraph/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /l/cnets/research/factcheckgraph/miniconda3/envs/env-factcheckgraph/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from knowledge_linker/algorithms/heap.c:256:
/l/cnets/research/factcheckgraph/miniconda3/envs/env-factcheckgraph/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
/l/cnets/research/factcheckgraph/miniconda3/envs/env-factcheckgraph/lib/python3.6/site-packages/numpy/core/include/numpy/__multiarray_api.h:1463: warning: ‘_import_array’ defined but not used
gcc -pthread -shared -B /l/cnets/research/factcheckgraph/env-factcheckgraph/compiler_compat -L/l/cnets/research/factcheckgraph/env-factcheckgraph/lib -Wl,-rpath=/l/cnets/research/factcheckgraph/env-factcheckgraph/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/knowledge_linker/algorithms/heap.o -o build/lib.linux-x86_64-3.6/knowledge_linker/algorithms/heap.cpython-36m-x86_64-linux-gnu.so
/usr/bin/ld: this linker was not configured to use sysroots
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Numpy version 1.15.1

Using importnt to create WKG

importnt allns.tsv instance_types_en.nt

WARNING: the n-triples file must be already sorted by source, destination!

Traceback (most recent call last):
File "/home/kenv/bin/importnt", line 11, in
load_entry_point('knowledge-linker==0.1rc0', 'console_scripts', 'importnt')()
File "build/bdist.linux-x86_64/egg/knowledge_linker/io/importnt.py", line 127, in main
NameError: global name 'readns' is not defined

C extension implementation returns paths with more hops

When multiple paths with the same proximity are available, sometime the Cython implementation (cclosuress) returns paths with more hops than the pure Python implementation (closuress).

This bug was surfaced in knowledge_linker.tests.test_closure.test_closure_rand; it may be a Cython specific issue since regression shows it was introduced in 31589e6 (464d864fd1979229a8f5412f31ae04a5282d5848 on Github.IU), but it seems that the test started failing only recently when a newer version of Cython was used to regenerate the C extension modules.

How to use

Hello,

I am very interested in this project. I have installed and used ontoparse & importnt to create the adjacency matrices.

I am interested in the confmatrix command of klinker but I am a bit confused on what each of the options mean.

uris node uris
graph adjacency matrix
source sources input file
target targets input file
output output file

I know that graph would the adjacency graph, but the other I would love some extra details. Thank you!

Instantiating multiprocessing.Array in very large networks

When networks are huge (ie., with sparse non-negative records >1e9), the instantiating of multiprocessing.Array(c_int, A.indices) or A.data fails in python 2.7:

  File "test.py", line 53, in <module>
    Bm = backbone(A, kind=kind, start=None, offset=None, nprocs=nprocs)
  File "../knowledge_linker/algorithms/closure.py", line 507, in backbone
    data = Array(c_double, A.data)
  File "../multiprocessing/__init__.py", line 260, in Array
    return Array(typecode_or_type, size_or_initializer, **kwds)
  File "../multiprocessing/sharedctypes.py", line 120, in Array
    obj = RawArray(typecode_or_type, size_or_initializer)
  File "../multiprocessing/sharedctypes.py", line 94, in RawArray
    result.__init__(*size_or_initializer)
SystemError: Objects/tupleobject.c:54: bad argument to internal function

Weirdly, it seems to work if the lines

indptr = Array(c_uint, A.indptr)
indices = Array(c_uint, A.indices)
data = Array(c_double, A.data)

are modified to

indptr = Array(c_int, len(A.indptr))
indptr[:] = A.indptr
indices = Array(c_int, len(A.indices))
indices[:] = A.indices
data = Array(c_double, len(A.data))
data[:] = A.data

... more to come.

unsupported option '-fopenmp' on Mac OS X

I'm getting the below output while trying to run setup.py file on MacOS Mojave

$ python setup.py nosetests
running nosetests
running egg_info
writing requirements to knowledge_linker.egg-info/requires.txt
writing knowledge_linker.egg-info/PKG-INFO
writing top-level names to knowledge_linker.egg-info/top_level.txt
writing dependency_links to knowledge_linker.egg-info/dependency_links.txt
writing entry points to knowledge_linker.egg-info/entry_points.txt
reading manifest file 'knowledge_linker.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'LICENSE.txt'
writing manifest file 'knowledge_linker.egg-info/SOURCES.txt'
building 'knowledge_linker.algorithms._maxmin' extension
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/Library/Python/2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c knowledge_linker/algorithms/_maxmin.c -o build/temp.macosx-10.14-intel-2.7/knowledge_linker/algorithms/_maxmin.o -fopenmp
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
error: command 'cc' failed with exit status 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.