SMART common issue and indivo dev branch

57 views
Skip to first unread message

wc...@njit.edu

unread,
Sep 18, 2014, 10:51:54 AM9/18/14
to smart-app-...@googlegroups.com
Hi,

I'm hoping someone can help me with this isse.  I upgraded my indivo from 2.0 to develop branch in order to take advantage of smart v0.5 schemas and now I have this problem relating to smart-commons:
Any help would be appreciated.

No handlers could be found for logger "rdflib.term"
Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
    return self.application(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 219, in __call__
    self.load_middleware()
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 45, in load_middleware
    mod = import_module(mw_module)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/data/indivo_server/indivo/middlewares/authentication.py", line 8, in <module>
    from indivo.accesscontrol import security
  File "/opt/data/indivo_server/indivo/accesscontrol/__init__.py", line 6, in <module>
    from access_rule import AccessRule
  File "/opt/data/indivo_server/indivo/accesscontrol/access_rule.py", line 4, in <module>
    from indivo.views import *
  File "/opt/data/indivo_server/indivo/views/__init__.py", line 24, in <module>
    from documents  import *
  File "/opt/data/indivo_server/indivo/views/documents/__init__.py", line 10, in <module>
    from document           import *
  File "/opt/data/indivo_server/indivo/views/documents/document.py", line 16, in <module>
    from indivo.document_processing.document_utils import DocumentUtils
  File "/opt/data/indivo_server/indivo/document_processing/__init__.py", line 193, in <module>
    loader.import_schemas()
  File "/opt/data/indivo_server/indivo/document_processing/__init__.py", line 65, in import_schemas
    for schema_name, schema_etree, transform_func in self.discover_schema_dirs():
  File "/opt/data/indivo_server/indivo/document_processing/__init__.py", line 125, in discover_schema_dirs
    transformation_func = transform_handler(schema_dir)
  File "/opt/data/indivo_server/indivo/document_processing/__init__.py", line 163, in _get_transform_from_py
    reload(module)
  File "/opt/data/indivo_server/indivo/../indivo/schemas/data/core/rdf/transform.py", line 3, in <module>
    from indivo.rdf import parser
  File "/opt/data/indivo_server/indivo/rdf/parser.py", line 5, in <module>
    from .transforms import *
  File "/opt/data/indivo_server/indivo/rdf/transforms/__init__.py", line 1, in <module>
    from .medication import MedicationTransform
  File "/opt/data/indivo_server/indivo/rdf/transforms/medication.py", line 5, in <module>
    from .base import BaseRDFTransform
  File "/opt/data/indivo_server/indivo/rdf/transforms/base.py", line 4, in <module>
    from smart_common.rdf_tools.rdf_ontology import api_types
  File "/opt/data/indivo_server/smart_common/rdf_tools/rdf_ontology.py", line 513, in <module>
    parse_ontology(f)
  File "/opt/data/indivo_server/smart_common/rdf_tools/rdf_ontology.py", line 480, in parse_ontology
    m = parse_rdf(f)
  File "/opt/data/indivo_server/smart_common/rdf_tools/util.py", line 44, in parse_rdf
    model.default_context.parse(data=string, format="n3")
  File "build/bdist.linux-x86_64/egg/rdflib/graph.py", line 1035, in parse
    parser.parse(source, self, **args)
  File "build/bdist.linux-x86_64/egg/rdflib/plugins/parsers/notation3.py", line 1887, in parse
    TurtleParser.parse(self, source, conj_graph, encoding, turtle=False)
  File "build/bdist.linux-x86_64/egg/rdflib/plugins/parsers/notation3.py", line 1858, in parse
    p.loadStream(source.getByteStream())
  File "build/bdist.linux-x86_64/egg/rdflib/plugins/parsers/notation3.py", line 422, in loadStream
    return self.loadBuf(stream.read())    # Not ideal
  File "build/bdist.linux-x86_64/egg/rdflib/plugins/parsers/notation3.py", line 428, in loadBuf
    self.feed(buf)
  File "build/bdist.linux-x86_64/egg/rdflib/plugins/parsers/notation3.py", line 454, in feed
    i = self.directiveOrStatement(s, j)
  File "build/bdist.linux-x86_64/egg/rdflib/plugins/parsers/notation3.py", line 477, in directiveOrStatement
    return self.checkDot(argstr, j)
  File "build/bdist.linux-x86_64/egg/rdflib/plugins/parsers/notation3.py", line 1147, in checkDot
    "expected '.' or '}' or ']' at end of statement")
  File "build/bdist.linux-x86_64/egg/rdflib/plugins/parsers/notation3.py", line 1603, in BadSyntax
    raise BadSyntax(self._thisDoc, self.lines, argstr, i, msg)
BadSyntax: at line 6 of <>:
Bad syntax (expected '.' or '}' or ']' at end of statement) at ^ in:
"...ms/" >
    <!ENTITY foaf "http://xmlns.com/foaf/0.1/" >
    ^<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
    <!ENTITY..."
[18/Sep/2014 14:35:45] "POST /oauth/internal/session_create HTTP/1.1" 500 59



Nikolai Schwertner

unread,
Sep 18, 2014, 11:17:23 AM9/18/14
to smart-app-...@googlegroups.com, Pascal Pfiffner
Hmm... It does sound like you may be facing a configuration issue with RDFLIB's logging functionality (see http://stackoverflow.com/questions/17393664/no-handlers-could-be-found-for-logger-rdflib-term). Unfortunately, Indivo is not my area of expertise. My colleague, Pascal, who may be able to answer this is currently on vacation, but I am CC-ing him anyway.

-Nikolai
--
You received this message because you are subscribed to the Google Groups "SMART App Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smart-app-develo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pascal Pfiffner

unread,
Sep 18, 2014, 11:36:22 AM9/18/14
to smart-app-...@googlegroups.com, Pascal....@childrens.harvard.edu
I wish I was on vacation. ;)

It complains about a syntax error in the RDF+XML shown at the bottom, however since I haven't worked on Indivo's SMART implementation and the person who has is no longer with us I'm afraid there is little I can do.

Nikolai Schwertner

unread,
Sep 18, 2014, 11:53:48 AM9/18/14
to smart-app-...@googlegroups.com
Another 2 cents... there may be a mismatch in the rdflib version and the code. Just a wild guess. ;)

Sorry that we can't be of more help.

wc...@njit.edu

unread,
Sep 18, 2014, 11:59:47 AM9/18/14
to smart-app-...@googlegroups.com, Pascal....@childrens.harvard.edu
Thank you both!

Once I fixed the logger I did get something about the contents being wrong:

INFO 2014-09-18 15:43:30,797 rdflib RDFLib Version: 4.1.2
WARNING 2014-09-18 15:44:56,754 rdflib.term file:///opt/data/?xml version="1.0"? does not look like a valid URI, trying to serialize this will break.
WARNING 2014-09-18 15:44:56,754 rdflib.term !DOCTYPE rdf:RDF [
    <!ENTITY dcterms "http://purl.org/dc/terms/"  does not look like a valid URI, trying to serialize this will break.
WARNING 2014-09-18 15:44:56,754 rdflib.term !ENTITY foaf "http://xmlns.com/foaf/0.1/"  does not look like a valid URI, trying to serialize this will break.
WARNING 2014-09-18 15:45:17,282 rdflib.term file:///opt/data/?xml version="1.0"? does not look like a valid URI, trying to serialize this will break.
WARNING 2014-09-18 15:45:17,283 rdflib.term !DOCTYPE rdf:RDF [
    <!ENTITY dcterms "http://purl.org/dc/terms/"  does not look like a valid URI, trying to serialize this will break.
WARNING 2014-09-18 15:45:17,283 rdflib.term !ENTITY foaf "http://xmlns.com/foaf/0.1/"  does not look like a valid URI, trying to serialize this will break.

I will try to figure out what the problem is with these lines

wc...@njit.edu

unread,
Sep 22, 2014, 10:52:49 AM9/22/14
to smart-app-...@googlegroups.com, Pascal....@childrens.harvard.edu
Anyone else have any idea what the issue could be with this document? Or how to get in touch with Travers.
Error:
Bad syntax (expected '.' or '}' or ']' at end of statement) at ^ in:
"...ms/" >
    <!ENTITY foaf "http://xmlns.com/foaf/0.1/" >
    ^<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
    <!ENTITY...". Skipping...

Doc goes like this:
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY dcterms 'http://purl.org/dc/terms/'>
<!ENTITY foaf 'http://xmlns.com/foaf/0.1/'>
]>


     xmlns:BloodPressureMethod="&spcode;BloodPressureMethod#"
     xmlns:EncounterType="&spcode;EncounterType#"
     xmlns:LabStatus="&spcode;LabStatus#"
     xmlns:foaf="http://xmlns.com/foaf/0.1/"
     xmlns:LabResultInterpretation="&spcode;LabResultInterpretation#"
     xmlns:TranslationFidelity="&spcode;TranslationFidelity#"
     xmlns:cemterms="http://smartplatforms.org/cemterms#"
     xmlns:ImmunizationRefusalReason="&spcode;ImmunizationRefusalReason#"
     xmlns:dcterms="http://purl.org/dc/terms/"
     xmlns:ImmunizationAdministrationStatus="&spcode;ImmunizationAdministrationStatus#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:mime="http://purl.org/NET/mediatypes/"
     xmlns:examples="http://smartplatforms.org/examples#">
    <owl:Ontology rdf:about="http://smartplatforms.org/terms#"/>

rest is mostly irrelevant the issue seems to be with the entity declarations.  I looked but they appear to follow the proper format for declaring entities in the doctype. Am I missing something?

Natalie Hodge

unread,
Sep 22, 2014, 11:35:16 AM9/22/14
to smart-app-...@googlegroups.com
how do I get off this list? 

Josh Mandel

unread,
Sep 25, 2014, 9:21:08 PM9/25/14
to smart-app-...@googlegroups.com
Hi Natalie,

I've removed you from the email list. (You're still subscribed to the google group, but you won't receive emails.) You can manage your own subscription further at https://groups.google.com/forum/#!forum/smart-app-developers

Best,

  Josh
Reply all
Reply to author
Forward
0 new messages