Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
79fa4f4
Add alert into json-ld-editor view=new page
mayerxc Jul 11, 2018
ae64fc4
more additions for editing existing instances
hansidm Jul 12, 2018
72835e2
first fully working version of the editor for existing instances
hansidm Jul 12, 2018
1cbd380
Fixed minor bug with incorrect footer url
rukmal Jul 18, 2018
914ac39
Add ability to collapse and expand json-ld-editor
mayerxc Jul 19, 2018
edb6f65
Merge branch 'editor' of https://github.com/tetherless-world/whyis in…
mayerxc Jul 19, 2018
672e8b5
CSS footer fix for chrome
mayerxc Jul 23, 2018
3d4618a
Switch expand/collapse buttons
mayerxc Jul 23, 2018
a33f608
Alert dialog for all constraints
mayerxc Jul 23, 2018
23ede28
Combine type chip with name at top of json-ld-directive
mayerxc Jul 30, 2018
ddf1620
added pellet depedency to whyis-java project
hansidm Jul 30, 2018
a1ddcbe
Add ID div to jsonLdEditor.html
mayerxc Jul 30, 2018
3515afe
type autocomple improvements
hansidm Jul 30, 2018
32f20f2
input for IDs changed to md-autocomplete
hansidm Jul 30, 2018
a774405
Collapse all after policy type by default in jsonLdEditor.js
mayerxc Jul 31, 2018
1196d7f
Merge branch 'editor' of https://github.com/tetherless-world/whyis in…
mayerxc Jul 31, 2018
e93ce9a
Change style on autocomplete ID to same as input box
mayerxc Jul 31, 2018
2cac7ba
Fix CSS for Footer on resource_view.html
mayerxc Aug 1, 2018
1aa4d0c
entityResolve enhacements for finding instances
hansidm Aug 1, 2018
e1a4df7
added possibility of rdf:type restriction to search.py
hansidm Aug 2, 2018
a6bad66
bux fixes for editing existing instances
hansidm Aug 3, 2018
9d33c7b
Add in ability to collapse/expand all buttons to jsonLdEditor
mayerxc Aug 6, 2018
93e4f5a
Add in ability to collapse/expand all buttons to edit_instance_view.html
mayerxc Aug 6, 2018
e758ee1
Change in default_vocab.ttl to test view=dsa
mayerxc Aug 22, 2018
22c331a
Add change in gitignore for node_modules
mayerxc Aug 23, 2018
c4ceeb6
new dsa view start page
hansidm Aug 23, 2018
835988f
dsa view
hansidm Aug 29, 2018
8e63565
Merge branch 'editor' of https://github.com/tetherless-world/whyis in…
mayerxc Aug 29, 2018
fd8fc26
Add in ability to add and remove the dsaAttribute directive
mayerxc Aug 29, 2018
8679c47
Background-color now extents past the viewport height for dsa_view.html
mayerxc Aug 29, 2018
eb9042e
spectrum related editor
hansidm Sep 5, 2018
e99e059
CSS fix on base.html for most views for background-color
mayerxc Sep 5, 2018
1eff121
spectrum related editor
hansidm Sep 5, 2018
5c1c068
Merge in changes
mayerxc Sep 5, 2018
90425d6
Merge in changes
mayerxc Sep 5, 2018
6f0c4b1
dsa policy builder
hansidm Sep 11, 2018
2736cd3
dsa multiple rules and statements
hansidm Sep 12, 2018
127096e
dsa policy builder enhacements
hansidm Sep 14, 2018
883dc4d
dsa domain-specific editor
hansidm Sep 26, 2018
66b50e6
attached effect and obligations to rule instead of policies
hansidm Sep 27, 2018
09083e5
dsa obligations rdf binding
hansidm Sep 28, 2018
462f6ea
improvements to dsa specific editor
hansidm Oct 5, 2018
ee648ce
Merge branch 'master' into editor
hansidm Oct 5, 2018
e639587
DSA domain-specific editor improvements
hansidm Oct 15, 2018
24beb79
Merge branch 'master' into editor
hansidm Oct 24, 2018
635f982
changes to the new attribute structure
hansidm Oct 30, 2018
2968d31
Merge branch 'master' into editor
hansidm Oct 30, 2018
567db85
dsa frequency range wiget
hansidm Oct 31, 2018
e3e1d4d
added top rule definition to policies
hansidm Nov 5, 2018
6173e69
Merge branch 'master' into editor
hansidm Nov 5, 2018
0fde10e
edit of existing policies
hansidm Nov 7, 2018
a815feb
extra parametrization for systems
hansidm Nov 9, 2018
5e00fbd
dsa labels fix
hansidm Nov 16, 2018
46735ff
further labels fix
hansidm Nov 16, 2018
9684ac3
Changed to pinned branch to work with content_type issue.
jpmccu Nov 20, 2018
4b1aba5
Merge branch 'master' into editor
jpmccu Nov 20, 2018
ba778df
Merge branch 'master' into editor
jpmccu Nov 21, 2018
138f52b
typo fix
hansidm Nov 26, 2018
5b00295
Merge branch 'editor' of https://github.com/tetherless-world/whyis in…
hansidm Nov 26, 2018
9666af0
Added Nanopublication list to class view
rashidsabbir Nov 28, 2018
fb4a3a0
Update README.md
jpmccu Nov 29, 2018
434dd36
Update install.md
jpmccu Nov 29, 2018
bfc4fb4
Update install.md
jpmccu Nov 29, 2018
7bc1cac
Updates to resource view to show attributes of resources
rashidsabbir Dec 2, 2018
5b56a92
Added url encoding to links for attributes and nanopublications for r…
rashidsabbir Dec 3, 2018
0fb0aea
fix for system types
hansidm Dec 3, 2018
ea3694d
Merge branch 'master' into editor
hansidm Dec 3, 2018
3e8c174
dsa code split
hansidm Dec 3, 2018
233f25a
dsa code split
hansidm Dec 3, 2018
53759f2
Merge pull request #44 from tetherless-world/editor
hansidm Dec 4, 2018
c9cc8b4
Fixed up command line-based file uploads through nanopubs, added plug…
jpmccu Dec 11, 2018
8e86efe
Reverted class view to previous commit
rashidsabbir Dec 11, 2018
93e09eb
Merge branch 'master' of https://github.com/tetherless-world/whyis
rashidsabbir Dec 11, 2018
a1be289
Reverted resource view back to previous commit
rashidsabbir Dec 11, 2018
2db30d1
Fixes for tutorial.
jpmccu Dec 12, 2018
af0f0ca
Added tutorial slides and supporting files.
jpmccu Dec 12, 2018
d30a111
Fixed follow along URL.
jpmccu Dec 12, 2018
2f22d0a
Fixed some styling.
jpmccu Dec 12, 2018
e0b3244
Switched over to using dev.whyis.io instead of IP address.
jpmccu Dec 12, 2018
a02d698
Fixed ubuntu version instructions.
jpmccu Dec 12, 2018
727155c
Fixed integbio setl link.
jpmccu Dec 12, 2018
048a4d9
Added namespace update
jpmccu Dec 12, 2018
b12d126
update jwt authenticator
bluedevelz Dec 13, 2018
f099ed8
Update to deductor class to expect dictionaries for the input prefixe…
rashidsabbir Jan 16, 2019
7991b03
Update install.pp
jpmccu Jan 23, 2019
0098067
Update install.pp
jpmccu Jan 23, 2019
9714ad0
Added improved faceting UI.
jpmccu Jan 30, 2019
3bf7238
Merge branch 'master' of https://github.com/tetherless-world/whyis
jpmccu Jan 30, 2019
5fe1b9d
Merge pull request #1 from tetherless-world/master
bluedevil-oit Feb 12, 2019
08c689d
Improved faceted browsing
jpmccu Feb 20, 2019
44c4d8b
Update install.pp
jpmccu Feb 20, 2019
8ff18db
Closer to a working visualizer.
jpmccu Feb 22, 2019
88dfbc6
Merge branch 'master' of https://github.com/tetherless-world/whyis
jpmccu Feb 22, 2019
a08292c
Initial visualizations successful.
jpmccu Feb 26, 2019
9ff4919
More improvements in variable search.
jpmccu Feb 27, 2019
ec72813
Merge pull request #2 from tetherless-world/master
bluedevil-oit Feb 28, 2019
4271b6e
Improved charts in vega.
jpmccu Mar 4, 2019
05ff9d3
Merge pull request #3 from tetherless-world/master
bluedevil-oit Mar 5, 2019
69b7f5b
Update authenticator.py
bluedevil-oit Mar 5, 2019
2246a7d
Update authenticator.py
bluedevil-oit Mar 5, 2019
5e9a8af
Update authenticator.py
bluedevil-oit Mar 5, 2019
ce5ce9c
fixed the file handle leak.
jpmccu Mar 5, 2019
7546b5f
Improved faceting for non-type facets.
jpmccu Mar 6, 2019
1900fef
Merge pull request #4 from tetherless-world/master
bluedevil-oit Mar 6, 2019
4059a2c
Updated setlr requirement to lastest working version
rashidsabbir Mar 19, 2019
1f3ca7f
Update install.md
jpmccu Mar 21, 2019
6a3b4c5
Found a bug in Werkzeug, maybe python 2 issue?
jpmccu Mar 21, 2019
cfb519d
Merge branch 'master' of https://github.com/tetherless-world/whyis
jpmccu Mar 21, 2019
fd89623
Froze redis version, version 3.0 and later is incompatible with our v…
jpmccu Mar 22, 2019
10fe687
Missing use of getLabel in label filter.
jpmccu Mar 22, 2019
61aaa5c
Merge pull request #5 from tetherless-world/master
bluedevil-oit Apr 1, 2019
fbccfba
Update to reset namespaces script to recreate the directories that it…
rashidsabbir Apr 1, 2019
5d0f5a6
Merge pull request #45 from bluedevil-oit/master
jpmccu Apr 4, 2019
4c722f2
Merge branch 'master' into master
jpmccu Apr 4, 2019
3313c22
Merge pull request #40 from rukmal/master
jpmccu Apr 4, 2019
8e4918b
Update to default config to include owl2 profiles and rules
rashidsabbir Apr 7, 2019
2e91f63
Merge branch 'master' of https://github.com/tetherless-world/whyis
rashidsabbir Apr 7, 2019
67f6dd6
Added CSS fix for chrome
jpmccu Apr 19, 2019
5ccfc65
Merge branch 'master' of https://github.com/tetherless-world/whyis
jpmccu Apr 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#Node install files
node_modules/

# Emacs backup files
*~

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Whyis

[Visit our project web site for more details on how to use Whyis.](http://tetherless-world.github.io/whyis)

Whyis is a nano-scale knowledge graph publishing, management, and analysis framework.
Whyis aims to support domain-aware management and curation of knowledge from many different sources. Its primary goal is to enable creation of useful domain- and data-driven knowledge graphs. Knowledge can be contributed and managed through direct user interaction, statistical analysis, or data ingestion from many different kinds of data sources. Every contribution to the knowledge graph is managed as a separate entity so that its provenance (publication status, attribution, and justification) is transparent and can be managed and used.

Expand Down
83 changes: 83 additions & 0 deletions authenticator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from flask import current_app
from flask_login import AnonymousUserMixin, login_user
import datetime

class InvitedAnonymousUser(AnonymousUserMixin):
'''A user that has been referred via an external application references but does not have a user account.'''
def __init__(self):
self.roles = ImmutableList()

def has_role(self, *args):
"""Returns `False`"""
return False

def is_active(self):
return True

@property
def is_authenticated(self):
return True


class Authenticator:
def authenticate(self, request, datastore, config):
pass

class APIKeyAuthenticator:
def __init__(self, key, request_arg='API_KEY'):
self.key = key
self.request_arg = request_arg

def authenticate(self, request, datastore, config):
if self.request_arg in request.args and request.args[self.request_arg] == self.key:
print 'logging in invited user'
user = InvitedAnonymousUser()
login_user(user)
return user

default_jwt_mapping = {
'identifier':'sub',
'email': 'mail',
'admin': 'isAdmin',
'givenName' : 'givenName',
'roles' : 'roles',
'familyName' : 'sn'
}

class JWTAuthenticator:
def __init__(self, key, cookie="token", algorithm='HS256', mapping=default_jwt_mapping):
import jwt
self.jwt = jwt
self.cookie = cookie
self.key = key
self.algorithm = algorithm
self.mapping = mapping

def authenticate(self, request, datastore, config):
token = request.cookies.get(self.cookie)
if token is not None:
try:
payload = self.jwt.decode(token, self.key, algorithms=[self.algorithm])
user = datastore.get_user(identifier=payload[self.mapping['identifier']])
if user is None:
role_objects = []
if self.mapping['roles'] in payload:
role_objects = payload[self.mapping['roles']]
if self.mapping['admin'] in payload:
if payload[self.mapping['admin']] == True:
role_objects.append('admin')
user = dict(identifier=payload[self.mapping['identifier']],
email=payload[self.mapping['email']],
givenName=payload[self.mapping['givenName']],
familyName=payload[self.mapping['familyName']],
confirmed_at = datetime.datetime.utcnow(),
roles = role_objects)
#user_obj = flask.current_app.datastore.create_user(**user)
user_obj = current_app.datastore.create_user(**user)
else :
user_obj = user
login_user(user_obj)
return user_obj
except self.jwt.ExpiredSignatureError:
return None

18 changes: 14 additions & 4 deletions autonomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

import tempfile

from depot.io.interfaces import StoredFile

whyis = rdflib.Namespace('http://vocab.rpi.edu/whyis/')
whyis = rdflib.Namespace('http://vocab.rpi.edu/whyis/')
np = rdflib.Namespace("http://www.nanopub.org/nschema#")
Expand Down Expand Up @@ -510,12 +512,21 @@ def process(self, i, o):
#triples += len(new_np)
#if triples > 10000:
self.app.nanopub_manager.publish(*to_publish)
nanopub_prepare_graph.store.close()
print 'Published'
for resource, obj in resources.items():
if hasattr(i, 'close'):
print "Closing", resource
try:
i.close()
except:
pass

class Deductor(UpdateChangeService):
def __init__(self, where, construct, explanation, resource="?resource", prefixes=None): # prefixes should be
if resource is not None:
self.resource = resource
self.prefixes = {}
if prefixes is not None:
self.prefixes = prefixes
self.where = where
Expand All @@ -530,19 +541,18 @@ def getOutputClass(self):

def get_query(self):
self.app.db.store.nsBindings={}
return '''%s SELECT DISTINCT %s WHERE {\n%s \nFILTER NOT EXISTS {\n%s\n\t}\n}''' %( self.prefixes, self.resource, self.where, self.construct )
return '''SELECT DISTINCT %s WHERE {\n%s \nFILTER NOT EXISTS {\n%s\n\t}\n}''' %( self.resource, self.where, self.construct )

def get_context(self, i):
context = {}
context_vars = self.app.db.query('''%s SELECT DISTINCT * WHERE {\n%s\nFILTER(str(%s)="%s") .\n}''' %( self.prefixes, self.where, self.resource, i.identifier) )
context_vars = self.app.db.query('''SELECT DISTINCT * WHERE {\n%s\nFILTER(str(%s)="%s") .\n}''' %( self.where, self.resource, i.identifier) , initNs=self.app.NS.prefixes )
for key in context_vars.json["results"]["bindings"][0].keys():
context[key]=context_vars.json["results"]["bindings"][0][key]["value"]
return context

def process(self, i, o):
self.app.db.store.nsBindings={}
npub = Nanopublication(store=o.graph.store)
triples = self.app.db.query('''%s CONSTRUCT {\n%s\n} WHERE {\n%s \nFILTER NOT EXISTS {\n%s\n\t}\nFILTER(str(%s)="%s") .\n}''' %( self.prefixes,self.construct, self.where, self.construct, self.resource, i.identifier) ) # init.bindings = prefix, dict for identifier (see graph.query in rdflib)
triples = self.app.db.query('''CONSTRUCT {\n%s\n} WHERE {\n%s \nFILTER NOT EXISTS {\n%s\n\t}\nFILTER(str(%s)="%s") .\n}''' %( self.construct, self.where, self.construct, self.resource, i.identifier) , initNs=self.prefixes )
for s, p, o, c in triples:
print "Deductor Adding ", s, p, o
npub.assertion.add((s, p, o))
Expand Down
1 change: 1 addition & 0 deletions commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def get_options(self):
]

def run(self, input_file, file_format="trig", was_revision_of=None):
flask.current_app.managed = True
if was_revision_of is not None:
wasRevisionOf = set(flask.current_app.db.objects(predicate=np.hasAssertion,
subject=rdflib.URIRef(was_revision_of)))
Expand Down
2 changes: 1 addition & 1 deletion config-template/{{cookiecutter.location}}/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

site_name = "{{cookiecutter.project_name}}",

site_header_image = '/static/images/random_network.png',
site_header_image = 'static/images/random_network.png',

site_description = '',

Expand Down
Loading