Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out how to activate the reasoning machine in Virtuoso. #100

Closed
candlecao opened this issue Jul 23, 2024 · 4 comments
Closed

Figure out how to activate the reasoning machine in Virtuoso. #100

candlecao opened this issue Jul 23, 2024 · 4 comments
Assignees
Labels
Priority: high high priority

Comments

@candlecao
Copy link
Contributor

So that we can (1) supplement some data to facilitate the reconciliation and semantic retrieval, (2) facilitate LLM2SPARQL.

@candlecao candlecao self-assigned this Jul 23, 2024
@candlecao candlecao added the Priority: high high priority label Jul 23, 2024
@candlecao
Copy link
Contributor Author

candlecao commented Jul 23, 2024

I have just learned how to open the reasoning machine(reasoner) using OWL or RDFS.
But I still don't know how to reason based on the owl:sameAs.

It doesn't matter, we can use this SPARQL as substitute:

PREFIX wdt: <http://www.wikidata.org/prop/direct/>

construct {
  ?InstanceA_wiki ?property ?InstanceB_wiki
  ?InstanceA_wiki ?property ?InstanceB_local.
  ?InstanceA_local ?property ?InstanceB_wiki.
}
where {
  ?InstanceA_local ?property ?InstanceB_local.
  ?InstanceA_local wdt:P2888 ?InstanceA_wiki.
  ?InstanceB_local wdt:P2888 ?InstanceB_wiki.
}

I would like to try it with @Yueqiao12Zhang, sometime.

@candlecao
Copy link
Contributor Author

candlecao commented Jul 23, 2024

I will keep on exploring how to activate owl:sameAs before long.

@candlecao
Copy link
Contributor Author

In pragmatic use, we can insert the triples into a designated graph, just by replacing CONSTRUCT by INSERT...GRAPH <>

PREFIX wdt: <http://www.wikidata.org/prop/direct/>

insert {
  graph <IRI of the designated graph> 
    {
      ?InstanceA_wiki ?property ?InstanceB_wiki.
      ?InstanceA_wiki ?property ?InstanceB_local.
      ?InstanceA_local ?property ?InstanceB_wiki.
    }
}
where {
  ?InstanceA_local ?property ?InstanceB_local.
  ?InstanceA_local wdt:P2888 ?InstanceA_wiki.
  ?InstanceB_local wdt:P2888 ?InstanceB_wiki.
}

@candlecao
Copy link
Contributor Author

candlecao commented Aug 1, 2024

I figured out the method without using SPARQL.
See this example:

  1. Import data with TTLP() via command-line ISQL
TTLP (
'@prefix wdt: <http://www.wikidata.org/prop/direct/> .
 <#InstanceA_local> <http://www.w3.org/2002/07/owl#sameAs> <#InstanceA_wiki> .
 <#InstanceB_local> <http://www.w3.org/2002/07/owl#sameAs> <#InstanceB_wiki> .
 <#InstanceA_local> wdt:P136 <#InstanceB_local> .
', '', 'http://g-sameAs', 0);
  1. Query via ISQL
SPARQL 
define input:same-as "yes" 
prefix wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?s FROM <http://g-sameAs> 
WHERE  {
  ?s ?p ?o ;
       wdt:P136  <#InstanceB_local> };
  1. You may make a contrast with:
SPARQL 
--define input:same-as "yes" 
prefix wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?s FROM <http://g-sameAs> 
WHERE  {
  ?s ?p ?o ;
       wdt:P136  <#InstanceB_local> };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: high high priority
Projects
None yet
Development

No branches or pull requests

1 participant