http://127.0.0.1:5984/rdf/_design/lookup/_view/by_subject function(doc) { if(doc.doc_type == 'RDFEntity' && doc.s) { emit(doc.s+doc.g, doc); } }