Skip to content

Commit

Permalink
some comments and removed the REVIEW doc from public view
Browse files Browse the repository at this point in the history
  • Loading branch information
emmettbutler committed Jan 29, 2013
1 parent 97d4ad9 commit 47a9c67
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 228 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@
schemato_config.py schemato_config.py
nohup.out nohup.out
*.smt *.smt
REVIEW.rst
222 changes: 0 additions & 222 deletions REVIEW.rst

This file was deleted.

1 change: 0 additions & 1 deletion schemato/schemato.py
Expand Up @@ -38,7 +38,6 @@ def import_module(name):
v_instance = getattr(v_package, module_string.split('.')[-1])(self.graph, self.doc_lines, url=self.url) v_instance = getattr(v_package, module_string.split('.')[-1])(self.graph, self.doc_lines, url=self.url)
self.validators.append(v_instance) self.validators.append(v_instance)



def validate(self): def validate(self):
results = [] results = []


Expand Down
6 changes: 1 addition & 5 deletions schemato/validator.py
Expand Up @@ -56,7 +56,6 @@ def validate(self):


def _check_triple(self, (subj, pred, obj)): def _check_triple(self, (subj, pred, obj)):
"""compare triple to ontology, return error or None""" """compare triple to ontology, return error or None"""
# don't bother with special 'type' triples
if self._field_name_from_uri(pred) in ['type', 'item', 'first', 'rest']: if self._field_name_from_uri(pred) in ['type', 'item', 'first', 'rest']:
log.info("ignoring triple with predicate '%s'" % self._field_name_from_uri(pred)) log.info("ignoring triple with predicate '%s'" % self._field_name_from_uri(pred))
return return
Expand All @@ -74,21 +73,18 @@ def _check_triple(self, (subj, pred, obj)):
if type(instanceof) == rt.URIRef: if type(instanceof) == rt.URIRef:
instanceof = self._expand_qname(instanceof) instanceof = self._expand_qname(instanceof)


# this method should differentiate between an "error" and a "warning"
# since not all issues with an implementation worth telling
# the user about are actual "errors", just things to keep in mind
class_invalid = self._validate_class(instanceof) class_invalid = self._validate_class(instanceof)
if class_invalid: if class_invalid:
log.warning("Invalid class %s" % instanceof) log.warning("Invalid class %s" % instanceof)
return class_invalid return class_invalid
# TODO - the above sometimes fails when a single object has more than one # TODO - the above sometimes fails when a single object has more than one
# rdfa type (eg <span property="schema:creator rnews:creator" typeof="schema:Person rnews:Person"> # rdfa type (eg <span property="schema:creator rnews:creator" typeof="schema:Person rnews:Person">
# Graph chooses the type in an arbitrary order, so it's unreliable # Graph chooses the type in an arbitrary order, so it's unreliable
# eg: http://semanticweb.com/the-impact-of-rdfa_b35003


classes = self._superclasses_for_subject(self.graph, instanceof) classes = self._superclasses_for_subject(self.graph, instanceof)
classes.append(instanceof) classes.append(instanceof)


# is this attribute a valid member of the class or superclasses?
member_invalid = self._validate_member(pred, classes, instanceof) member_invalid = self._validate_member(pred, classes, instanceof)
if member_invalid: if member_invalid:
log.warning("Invalid member of class") log.warning("Invalid member of class")
Expand Down

0 comments on commit 47a9c67

Please sign in to comment.