You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Brandon Sara <br...@collectivemedicaltech.com.INVALID> on 2021/05/07 19:44:18 UTC

Bug: Compact won't execute on inference dataset

I’ve found what I believe is a bug. If you try to run compaction via the fuseki-main `/$/compact/{ds}` endpoint on an `ja:RDFDataset` that has a defaultGraph of `ja:InfModel`, compaction will not execute because the resulting `DatasetGraphMapLink` type does not inherit `DatasetGraphSwitchable` nor `DatasetGraphWrapper`. I am able to run compaction just fine with the command line tool on this dataset, it is just being restricted from running when a request comes through `ActionCompact`.

I have written a test that can be used to duplicate the issue: https://github.com/bsara/jena/blob/compact-with-inference/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestConfigFile.java#L300-L323

I would try and fix the issue myself, but I know very little about the inner workings and intricacies of compaction, graph types, and how it all interacts.

No PHI in Email: PointClickCare and Collective Medical, A PointClickCare Company, policies prohibit sending protected health information (PHI) by email, which may violate regulatory requirements. If sending PHI is necessary, please contact the sender for secure delivery instructions.

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

Re: Bug: Compact won't execute on inference dataset

Posted by Brandon Sara <br...@collectivemedicaltech.com.INVALID>.
> Why is that?

It would be most helpful if we had one single endpoint to manage a dataset, rather than two.


> The HTTP operation ha to identify the database and DatasetGraphMapLink can have multiple, graphs from different databases.

Thank you for this info, I hadn’t realized that you could combine graphs from different DBs for a service.


> Compaction only works on TDB2 databases.

While this makes sense. The wording of the documentation and of the endpoint itself leads one to believe that the dataset in general, regardless of the fact that the DB is “wrapped” by graph logic like inference, is all that is required for a dataset that is ultimately backed by a TDB2 db. For instance: `/$/compact/{dataset}` is the verbiage that is used for the endpoint. But in the config, I can set the “dataset” of my service to something that ultimately references a TDB2 DB. How is one to know that “dataset” in the compaction endpoint is not necessarily synonymous to “dataset” in the assembler config?


> What sort of inference are you using?

We are using normal OWL inference via the different supplied OWL reasoners and one service that uses the transitive reasoner.

On May 8, 2021, at 3:17 AM, Andy Seaborne <an...@apache.org>> wrote:

"EXTERNAL EMAIL" - This email originated from outside of the organization. Do not click or open attachments unless you recognize the sender and know the content is safe. If you are unsure, please contact CTS at helpme@pointclickcare.com<ma...@pointclickcare.com>.



On 08/05/2021 00:05, Brandon Sara wrote:
While I can see how this will work, it is a pretty undesirable solution.

Why is that?

Are there any other options? Or is there a way to get this working for a situation like this in the code?

The HTTP operation ha to identify the database and DatasetGraphMapLink can have multiple, graphs from different databases.

The type of configuration in the test is quite prevalent in the docs and examples. I would think that there should either be a disclaimer that compaction won’t work if the pattern is used or the code should be updated to work for the situation, no?

Compaction only works on TDB2 databases.

An inference service isn't a TDB2 database.

What sort of inference are you using?

   Andy

On May 7, 2021, at 3:28 PM, Andy Seaborne <an...@apache.org>> wrote:

"EXTERNAL EMAIL" - This email originated from outside of the organization. Do not click or open attachments unless you recognize the sender and know the content is safe. If you are unsure, please contact CTS at helpme@pointclickcare.com<ma...@pointclickcare.com>.



On 07/05/2021 20:44, Brandon Sara wrote:
I’ve found what I believe is a bug. If you try to run compaction via the fuseki-main `/$/compact/{ds}` endpoint on an `ja:RDFDataset` that has a defaultGraph of `ja:InfModel`, compaction will not execute because the resulting `DatasetGraphMapLink` type does not inherit `DatasetGraphSwitchable` nor `DatasetGraphWrapper`. I am able to run compaction just fine with the command line tool on this dataset, it is just being restricted from running when a request comes through `ActionCompact`.

Correct - while DatasetGraphWrapper might be possible, DatasetGraphMapLink is an independent ass

There are many ways datasets can be build out of dataets and models.

But you don't need to.

You can have a service that exposes the dataset directly.

# Service 1
<#data> rdf:type fuseki:Service ;
   fuseki:name "withInference" ;
   fuseki:dataset <#inf-dataset> .

<#inf-dataset>
 ....

:tdbGraph rdf:type tdb2:GraphTDB2 ;
   tdb2:dataset <#storage> .

# Service 2
## storage

<#tdb> rdf:type fuseki:Service ;
   fuseki:name "storage" ;
   # No operations or endpoints.
   fuseki:dataset <#dataset> ;
.

<#storage>  rdf:type  tdb2:DatasetTDB2 ;
   tdb2:location "DB2"
   .

then compact admin operations to
 http://localhost:3030/$/compact/storage

      Andy

I have written a test that can be used to duplicate the issue: https://github.com/bsara/jena/blob/compact-with-inference/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestConfigFile.java#L300-L323
I would try and fix the issue myself, but I know very little about the inner workings and intricacies of compaction, graph types, and how it all interacts.

No PHI in Email: PointClickCare and Collective Medical, A PointClickCare Company, policies prohibit sending protected health information (PHI) by email, which may violate regulatory requirements. If sending PHI is necessary, please contact the sender for secure delivery instructions.
Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.


No PHI in Email: PointClickCare and Collective Medical, A PointClickCare Company, policies prohibit sending protected health information (PHI) by email, which may violate regulatory requirements. If sending PHI is necessary, please contact the sender for secure delivery instructions.

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

Re: Bug: Compact won't execute on inference dataset

Posted by Andy Seaborne <an...@apache.org>.

On 08/05/2021 00:05, Brandon Sara wrote:
> While I can see how this will work, it is a pretty undesirable solution.

Why is that?

> Are there any other options? Or is there a way to get this working for a situation like this in the code?

The HTTP operation ha to identify the database and DatasetGraphMapLink 
can have multiple, graphs from different databases.

> The type of configuration in the test is quite prevalent in the docs and examples. I would think that there should either be a disclaimer that compaction won’t work if the pattern is used or the code should be updated to work for the situation, no?

Compaction only works on TDB2 databases.

An inference service isn't a TDB2 database.

What sort of inference are you using?

     Andy

> 
>> On May 7, 2021, at 3:28 PM, Andy Seaborne <an...@apache.org> wrote:
>>
>> "EXTERNAL EMAIL" - This email originated from outside of the organization. Do not click or open attachments unless you recognize the sender and know the content is safe. If you are unsure, please contact CTS at helpme@pointclickcare.com.
>>
>>
>>
>> On 07/05/2021 20:44, Brandon Sara wrote:
>>> I’ve found what I believe is a bug. If you try to run compaction via the fuseki-main `/$/compact/{ds}` endpoint on an `ja:RDFDataset` that has a defaultGraph of `ja:InfModel`, compaction will not execute because the resulting `DatasetGraphMapLink` type does not inherit `DatasetGraphSwitchable` nor `DatasetGraphWrapper`. I am able to run compaction just fine with the command line tool on this dataset, it is just being restricted from running when a request comes through `ActionCompact`.
>>
>> Correct - while DatasetGraphWrapper might be possible, DatasetGraphMapLink is an independent ass
>>
>> There are many ways datasets can be build out of dataets and models.
>>
>> But you don't need to.
>>
>> You can have a service that exposes the dataset directly.
>>
>> # Service 1
>> <#data> rdf:type fuseki:Service ;
>>     fuseki:name "withInference" ;
>>     fuseki:dataset <#inf-dataset> .
>>
>> <#inf-dataset>
>>   ....
>>
>> :tdbGraph rdf:type tdb2:GraphTDB2 ;
>>     tdb2:dataset <#storage> .
>>
>> # Service 2
>> ## storage
>>
>> <#tdb> rdf:type fuseki:Service ;
>>     fuseki:name "storage" ;
>>     # No operations or endpoints.
>>     fuseki:dataset <#dataset> ;
>> .
>>
>> <#storage>  rdf:type  tdb2:DatasetTDB2 ;
>>     tdb2:location "DB2"
>>     .
>>
>> then compact admin operations to
>>   http://localhost:3030/$/compact/storage
>>
>>        Andy
>>
>>> I have written a test that can be used to duplicate the issue: https://github.com/bsara/jena/blob/compact-with-inference/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestConfigFile.java#L300-L323
>>> I would try and fix the issue myself, but I know very little about the inner workings and intricacies of compaction, graph types, and how it all interacts.
>>
> 
> No PHI in Email: PointClickCare and Collective Medical, A PointClickCare Company, policies prohibit sending protected health information (PHI) by email, which may violate regulatory requirements. If sending PHI is necessary, please contact the sender for secure delivery instructions.
> 
> Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
> 

Re: Bug: Compact won't execute on inference dataset

Posted by Brandon Sara <br...@collectivemedicaltech.com.INVALID>.
While I can see how this will work, it is a pretty undesirable solution. Are there any other options? Or is there a way to get this working for a situation like this in the code?

The type of configuration in the test is quite prevalent in the docs and examples. I would think that there should either be a disclaimer that compaction won’t work if the pattern is used or the code should be updated to work for the situation, no?

> On May 7, 2021, at 3:28 PM, Andy Seaborne <an...@apache.org> wrote:
>
> "EXTERNAL EMAIL" - This email originated from outside of the organization. Do not click or open attachments unless you recognize the sender and know the content is safe. If you are unsure, please contact CTS at helpme@pointclickcare.com.
>
>
>
> On 07/05/2021 20:44, Brandon Sara wrote:
>> I’ve found what I believe is a bug. If you try to run compaction via the fuseki-main `/$/compact/{ds}` endpoint on an `ja:RDFDataset` that has a defaultGraph of `ja:InfModel`, compaction will not execute because the resulting `DatasetGraphMapLink` type does not inherit `DatasetGraphSwitchable` nor `DatasetGraphWrapper`. I am able to run compaction just fine with the command line tool on this dataset, it is just being restricted from running when a request comes through `ActionCompact`.
>
> Correct - while DatasetGraphWrapper might be possible, DatasetGraphMapLink is an independent ass
>
> There are many ways datasets can be build out of dataets and models.
>
> But you don't need to.
>
> You can have a service that exposes the dataset directly.
>
> # Service 1
> <#data> rdf:type fuseki:Service ;
>    fuseki:name "withInference" ;
>    fuseki:dataset <#inf-dataset> .
>
> <#inf-dataset>
>  ....
>
> :tdbGraph rdf:type tdb2:GraphTDB2 ;
>    tdb2:dataset <#storage> .
>
> # Service 2
> ## storage
>
> <#tdb> rdf:type fuseki:Service ;
>    fuseki:name "storage" ;
>    # No operations or endpoints.
>    fuseki:dataset <#dataset> ;
> .
>
> <#storage>  rdf:type  tdb2:DatasetTDB2 ;
>    tdb2:location "DB2"
>    .
>
> then compact admin operations to
>  http://localhost:3030/$/compact/storage
>
>       Andy
>
>> I have written a test that can be used to duplicate the issue: https://github.com/bsara/jena/blob/compact-with-inference/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestConfigFile.java#L300-L323
>> I would try and fix the issue myself, but I know very little about the inner workings and intricacies of compaction, graph types, and how it all interacts.
>

No PHI in Email: PointClickCare and Collective Medical, A PointClickCare Company, policies prohibit sending protected health information (PHI) by email, which may violate regulatory requirements. If sending PHI is necessary, please contact the sender for secure delivery instructions.

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

Re: Bug: Compact won't execute on inference dataset

Posted by Andy Seaborne <an...@apache.org>.

On 07/05/2021 20:44, Brandon Sara wrote:
> I’ve found what I believe is a bug. If you try to run compaction via the fuseki-main `/$/compact/{ds}` endpoint on an `ja:RDFDataset` that has a defaultGraph of `ja:InfModel`, compaction will not execute because the resulting `DatasetGraphMapLink` type does not inherit `DatasetGraphSwitchable` nor `DatasetGraphWrapper`. I am able to run compaction just fine with the command line tool on this dataset, it is just being restricted from running when a request comes through `ActionCompact`.

Correct - while DatasetGraphWrapper might be possible, 
DatasetGraphMapLink is an independent ass

There are many ways datasets can be build out of dataets and models.

But you don't need to.

You can have a service that exposes the dataset directly.

# Service 1
<#data> rdf:type fuseki:Service ;
     fuseki:name "withInference" ;
     fuseki:dataset <#inf-dataset> .

<#inf-dataset>
   ....

:tdbGraph rdf:type tdb2:GraphTDB2 ;
     tdb2:dataset <#storage> .

# Service 2
## storage

<#tdb> rdf:type fuseki:Service ;
     fuseki:name "storage" ;
     # No operations or endpoints.
     fuseki:dataset <#dataset> ;
.

<#storage>  rdf:type  tdb2:DatasetTDB2 ;
     tdb2:location "DB2"
     .

then compact admin operations to
   http://localhost:3030/$/compact/storage

	Andy

> 
> I have written a test that can be used to duplicate the issue: https://github.com/bsara/jena/blob/compact-with-inference/jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestConfigFile.java#L300-L323
> 
> I would try and fix the issue myself, but I know very little about the inner workings and intricacies of compaction, graph types, and how it all interacts.