Skip to content

Commit

Permalink
Add RDF comparator and remove use of "name" col from "biomarkers" table
Browse files Browse the repository at this point in the history
  • Loading branch information
nutjob4life committed Oct 9, 2023
1 parent 180ffd4 commit 3937573
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 3 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ namespace_packages = edrn
package_dir =
= src
packages = find:
python_requires = >= 3.9, <3.11
python_requires = >= 3.9, <3.12
install_requires =
rdflib ~= 6.1.0
rdflib ~= 7.0.0
pymysql ~= 1.0.2
pyramid ~= 2.0

Expand Down Expand Up @@ -49,5 +49,4 @@ console_scripts =
report52 = edrn.bmdb.report52:main
zombie = edrn.bmdb.maureen_zombie_report:main
kristen = edrn.bmdb.kristen_report:main


rdfcompare = edrn.bmdb.compare:main
4 changes: 2 additions & 2 deletions src/edrn/bmdb/rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ def publications(connection, graph, public):

def biomarkers(connection, graph, public):
bioType, bsdType = rdflib.URIRef(_bmdb.Biomarker), rdflib.URIRef(_bmdb.BiomarkerStudyData)
query = 'SELECT id, name, shortName, description, qastate, phase, security, type, isPanel, panelID, curatorNotes FROM biomarkers'
query = 'SELECT id, shortName, description, qastate, phase, security, type, isPanel, panelID, curatorNotes FROM biomarkers'
if public:
query += " WHERE qastate != 'Under Review'"
biocursor = connection.cursor()
biocursor.execute("SET CHARACTER_SET_RESULTS='latin1'")
biocursor.execute(query)
# TODO: get created & modified datetimes?
for dbid, name, shortName, desc, qaState, phase, security, btype, isPanel, panelID, curatorNotes in biocursor.fetchall():
for dbid, shortName, desc, qaState, phase, security, btype, isPanel, panelID, curatorNotes in biocursor.fetchall():
isPublicBiomaker = qaState == 'Accepted'

subject = rdflib.URIRef('{}biomarkers/view/{}'.format(_biomarkerBase, dbid))
Expand Down
4 changes: 3 additions & 1 deletion src/edrn/bmdb/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ def __init__(self, request):

def includePrivate(self):
'''Return true if the request for this view wants *all* entities or False if just the public ones'''
return self.request.params.get('all') == os.getenv('TOKEN')
supplied, expected = self.request.params.get('all'), os.getenv('TOKEN')
rc = supplied == expected
return rc

def serialize(self, graph):
'''Serialize the given RDF ``graph`` into an HTTP response'''
Expand Down

0 comments on commit 3937573

Please sign in to comment.