-- stratum 0 advertising
op1_exposed_field(Record,'#Joinery',index,'publication') :- Field(Record,'#Joinery',index,'publication'), Have(Record).
op1_exposed_field(Record,'#Joinery-Reach',index,'localhost') :- Field(Record,'#Joinery-Reach',index,'localhost'), Have(Record).
op1_exposed_field(Record,'#Joinery-Reach',index,'native') :- Field(Record,'#Joinery-Reach',index,'native'), Have(Record).
op1_exposed_field(Record,'By','0',value) :- Field(Record,'By','0',value), Have(Record).
op1_exposed_field(Record,'Serial',index,value) :- Field(Record,'Serial',index,value), Have(Record).
-- stratum 1 advertising
op1_exposed_recordlink(Record,'Bundle+Link','0','bundle',Target) :- RecordLink(Record,'Bundle+Link','0','bundle',Target), Have(Record).
op1_exposed_recordlink(Record,'Child+Link',index,data,Target) :- RecordLink(Record,'Child+Link',index,data,Target), Have(Record).
op1_exposed_recordlink(Record,'Chunk+Link',index,data,Target) :- RecordLink(Record,'Chunk+Link',index,data,Target), Have(Record).
op1_exposed_recordlink(Record,'File+Link',index,data,Target) :- RecordLink(Record,'File+Link',index,data,Target), Have(Record).
op1_exposed_recordlink(Record,'Page+Link',index,data,Target) :- RecordLink(Record,'Page+Link',index,data,Target), Have(Record).
op1_exposed_recordlink(Record,'Root+Link',index,'files',Target) :- RecordLink(Record,'Root+Link',index,'files',Target), Have(Record).
-- stratum 2 advertising
op1_helper_constraint0_helper_publisher('V.8qgOfsaEJkK1tzX51sTT9NKdM8J2SrzQq6k8cRPzvP0.H3') :- true.
-- stratum 3 advertising
op1_helper_constraint0_helper_publication(P) :- Have(P), op1_exposed_field(P,'#Joinery',_,'publication'), op1_exposed_field(P,'By','0',by), op1_helper_constraint0_helper_publisher(by), op1_exposed_field(P,'Serial',_,_).
-- stratum 4 advertising
op1_helper_constraint0_helper_root(R) :- op1_helper_constraint0_helper_publication(P), op1_exposed_recordlink(P,'Bundle+Link','0','bundle',R).
-- stratum 5 advertising
op1_helper_constraint0_helper_directory(D) :- op1_helper_constraint0_helper_directory(Parent), Have(Parent), op1_exposed_recordlink(Parent,'Child+Link',_,_,D).
op1_helper_constraint0_helper_directory(D) :- op1_helper_constraint0_helper_directory(Parent), Have(Parent), op1_exposed_recordlink(Parent,'Page+Link',_,_,D).
op1_helper_constraint0_helper_directory(D) :- op1_helper_constraint0_helper_root(R), Have(R), op1_exposed_recordlink(R,'Root+Link',_,'files',D).
-- stratum 6 advertising
op1_helper_constraint0_helper_file(F) :- op1_helper_constraint0_helper_directory(D), Have(D), op1_exposed_recordlink(D,'File+Link',_,_,F).
op1_helper_constraint0_helper_file(F) :- op1_helper_constraint0_helper_file(Parent), Have(Parent), op1_exposed_recordlink(Parent,'Chunk+Link',_,_,F).
-- stratum 7 advertising
op1_helper_constraint0_helper_held(R) :- op1_helper_constraint0_helper_directory(R), Have(R).
op1_helper_constraint0_helper_held(R) :- op1_helper_constraint0_helper_file(R), Have(R).
op1_helper_constraint0_helper_held(R) :- op1_helper_constraint0_helper_publication(R).
op1_helper_constraint0_helper_held(R) :- op1_helper_constraint0_helper_root(R), Have(R).
-- stratum 8 advertising
op1_facet_selectstoredrecord(Record) :- op1_helper_constraint0_helper_held(Record), not op1_exposed_field(Record,'#Joinery-Reach',_,'localhost'), not op1_exposed_field(Record,'#Joinery-Reach',_,'native').
-- stratum 9 advertising
lace_may_send(Record) :- Have(Record), op1_facet_selectstoredrecord(Record).
