def clause2concepts(filename, rel_name, schema, closures=[]):
 concepts = []
 subj = 0
 pkey = schema[0]
 fields = schema[1:]
 records = _str2records(filename, rel_name)
 if (not (filename in not_unary)):
  concepts.append(unary_concept(pkey, subj, records))
 for field in fields:
  obj = schema.index(field)
  concepts.append(binary_concept(field, closures, subj, obj, records))
 return concepts

def clause2concepts ( filename , rel_name , schema , closures = [ ] ) : concepts = [ ] subj = 0 pkey = schema [ 0 ] fields = schema [ 1 : ] records = _str2records ( filename , rel_name ) if ( not ( filename in not_unary ) ) : concepts . append ( unary_concept ( pkey , subj , records ) ) for field in fields : obj = schema . index ( field ) concepts . append ( binary_concept ( field , closures , subj , obj , records ) ) return concepts
convert a file of prolog clauses into a list of concept objects .