web/views/rdf.py
branchstable
changeset 7911 5ab88d05083f
parent 7519 4e531c8697f8
child 7987 0977d9594d3c
equal deleted inserted replaced
7909:71c70bf482cf 7911:5ab88d05083f
    87                                 for item in xy.xeq('%s %s' % (entity.e_schema.type, rtype)):
    87                                 for item in xy.xeq('%s %s' % (entity.e_schema.type, rtype)):
    88                                     add( (cwuri, urijoin(item[1]), Literal(value)) )
    88                                     add( (cwuri, urijoin(item[1]), Literal(value)) )
    89                             except xy.UnsupportedVocabulary:
    89                             except xy.UnsupportedVocabulary:
    90                                 pass
    90                                 pass
    91                     else:
    91                     else:
    92                         for related in entity.related(rtype, role, entities=True):
    92                         try:
    93                             if role == 'subject':
    93                             for related in entity.related(rtype, role, entities=True, safe=True):
    94                                 add( (cwuri, CW[rtype], URIRef(related.cwuri)) )
    94                                 if role == 'subject':
    95                                 try:
    95                                     add( (cwuri, CW[rtype], URIRef(related.cwuri)) )
    96                                     for item in xy.xeq('%s %s' % (entity.e_schema.type, rtype)):
    96                                     try:
    97                                         add( (cwuri, urijoin(item), URIRef(related.cwuri)) )
    97                                         for item in xy.xeq('%s %s' % (entity.e_schema.type, rtype)):
    98                                 except xy.UnsupportedVocabulary:
    98                                             add( (cwuri, urijoin(item), URIRef(related.cwuri)) )
    99                                     pass
    99                                     except xy.UnsupportedVocabulary:
   100                             else:
   100                                         pass
   101                                 add( (URIRef(related.cwuri), CW[rtype], cwuri) )
   101                                 else:
       
   102                                     add( (URIRef(related.cwuri), CW[rtype], cwuri) )
       
   103                         except Unauthorized:
       
   104                             pass
   102 
   105 
   103