Skip to content

Instantly share code, notes, and snippets.

@ahmad88me
Last active November 30, 2018 15:26
Show Gist options
  • Save ahmad88me/f7d906f6cc9904a5513d0e1523560967 to your computer and use it in GitHub Desktop.
Save ahmad88me/f7d906f6cc9904a5513d0e1523560967 to your computer and use it in GitHub Desktop.
HDT estimatedNumResults
int main(){
string property_uri = "x:x";
string HDT_FNAME = "sample.hdt";
HDT *hdt = HDTManager::mapHDT(HDT_FNAME.c_str());
cout << "\nnumber of entities for property <"<< property_uri << ">: "<< hdt->search("", property_uri.c_str(), "")->estimatedNumResults();
auto itt = hdt->search("", property_uri.c_str(), "");
long i;
while(itt->hasNext()){
i++;
itt->next();
}
cout << "\niterationts: "<<i <<endl;
cout << "\nDone\n";
return 0;
}
<x:x> <x:x> <x:x>.
<x:x> <x:y> <x:x>.
<x:x> <x:y> <x:x>.
<x:x> <x:z> <x:x>.
<x:x> <x:z> <x:x>.
<x:x> <x:z> <x:x>.
<x:x> <x:a> <x:x>.
<x:x> <x:b> <x:x>.
<x:x> <x:c> <x:x>.
<x:x> <x:d> <x:x>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment