On Aug 25, 2014, at 12:03 PM, Andy Seaborne <[email protected]> wrote:
> On 25/08/14 18:58, Hubert A Le Van Gong wrote:
>> Actually this does not work because I need a dataset to invoke
>> isBackedByTDB() or location().
>> So restating my question a bit: given a directory (String), what is the best
>> way to verify that the dataset exists at the data store level?
>>
>> Thanks,
>> Hubert
>
>
> Location.exists()
>
> There isn't a way to verify it is a TDB-formatted directory (TDB autoformats
> anyway).
>
> Looking for some necessary files (e.g. SPO.dat, SPO.idn) in the Location
> should work.
>
> Andy
Hi,
hmm, I tried the following but it does not seem to work (dataset is never
found).
String directory = DBpath.concat("/" + datasetID);
Location loc = Location.mem(directory);
boolean isbacked = loc.exists();
if (isbacked) {
log.debug("=> Found dataset to be deleted.");
} else {
log.debug("=> dataset to be deleted not found.");
}
Maybe it's the way I initialize the Location?
BTW, how does one remove a dataset from a TDB store?
I didn't see a dedicated API call for this.
Cheers,
Hubert
>
>>
>>
>> On Aug 25, 2014, at 10:11 AM, Hubert A Le Van Gong <[email protected]>
>> wrote:
>>
>>> Hello,
>>>
>>> Is TDBFactory.isBackedByTDB() the proper way to simply test for the
>>> existence of a dataset?
>>>
>>>
>>> Thanks,
>>> Hubert
>>>
>>
>