Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
d94169eb
Commit
d94169eb
authored
Sep 10, 2019
by
Alexander Lercher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Semantic Linking: working semantic linking logic without integration
parent
b365f613
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
610 deletions
+14
-610
Created_classes_for_semantic_linking_logic.patch
...vice/app/Created_classes_for_semantic_linking_logic.patch
+0
-602
SemanticLinking.py
...c-linking-microservice/app/initialdemo/SemanticLinking.py
+11
-3
MessageHandler.py
...ntic-linking-microservice/app/messaging/MessageHandler.py
+3
-5
No files found.
data-hub/semantic-linking-microservice/app/Created_classes_for_semantic_linking_logic.patch
deleted
100644 → 0
View file @
b365f613
This diff is collapsed.
Click to expand it.
data-hub/semantic-linking-microservice/app/initialdemo/SemanticLinking.py
View file @
d94169eb
import
networkx
as
nx
import
matplotlib.pyplot
as
plt
from
collections
import
Counter
import
initialdemo.
HyperGraph
as
hg
import
HyperGraph
as
hg
import
pandas
as
pd
import
json
import
warnings
...
...
@@ -12,6 +12,13 @@ import mplleaflet
import
values
as
values
from
matplotlib
import
colors
# pip install networkx
# pip install matplotlib
# pip install pandas
# pip install community
# pip install mplleaflet
# pip install values
class
SemanticLinking
:
def
__init__
(
self
):
...
...
@@ -100,6 +107,7 @@ class SemanticLinking:
weight1
=
[]
node_adjacencies
=
[]
labeling
=
{}
def
drawedges
(
self
):
...
...
@@ -116,7 +124,7 @@ class SemanticLinking:
self
.
G
.
__setattr__
(
'weight'
,
self
.
weight1
)
def
labeling
(
self
):
def
do
labeling
(
self
):
"""label_propagation_communities(G) """
...
...
@@ -201,7 +209,7 @@ class SemanticLinking:
def
main
(
self
):
self
.
drawedges
()
self
.
labeling
()
self
.
do
labeling
()
self
.
findigneighbors
()
self
.
result
()
...
...
data-hub/semantic-linking-microservice/app/messaging/MessageHandler.py
View file @
d94169eb
...
...
@@ -2,16 +2,13 @@ import json
import
requests
from
threading
import
Thread
import
network_constants
as
netconst
from
intelligence_zahra.Processor
import
Processor
import
logging
LOGGER
=
logging
.
getLogger
(
__name__
)
class
MessageHandler
:
_processor
:
Processor
=
None
def
__init__
(
self
):
self
.
_processor
=
Processor
()
pass
def
handle_generic
(
self
,
body
):
LOGGER
.
info
(
f
"Received message: {body}"
)
...
...
@@ -43,6 +40,7 @@ class MessageHandler:
if
response
.
status_code
==
200
:
traces
=
response
.
json
()
Thread
(
target
=
self
.
_processor
.
process
(
traces
))
.
start
()
# TODO integrate zahras code
# Thread(target=self._processor.process(traces)).start()
else
:
LOGGER
.
error
(
f
"Could not retrieve JSON from {url} with GET request ({response.status_code})"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment