CURIE issues

1 view
Skip to first unread message

Bill DeSmedt

unread,
Jul 9, 2019, 3:55:30 PM7/9/19
to ErgoAI, Flora-2, and XSB Users Forum
I'm having trouble understanding how to use the IRIs specified as the third (?IriPrefixes) argument to the rdf_load command.
This command seems to work to set the IRIs up --

System[rdf_load('/Users/bill.desmedt/Desktop/geo_ontology.owl','','geo = "https://[actual-path-name]/geo-ontology#"',geomod)]@\owl.

-- i.e., it produces no syntax errors, and the original query (shown immediately below) still yields the desired result (inter alia, a list of all the US States belonging to the sales region in question):

"https://[actual-path-name]/geo-ontology#US_West_Sales_Region"^^\iri[?P->?O]@geomod.

However, my attempts to actually use the compact URI thus created have all failed. So far, I've tried the variations below. with the results shown in parentheses:

"geo:US_West_Sales_Region"^^\iri[?P->?O]@geomod.
  (returns "No answers found")
geo:US_West_Sales_Region^^\iri[?P->?O]@geomod.
   (returns syntax error)
geo:US_West_Sales_Region[?P->?O]@geomod.
   (returns "No answers found")
geo:"US_West_Sales_Region"^^\iri[?P->?O]@geomod.
   (returns syntax error)
  
I'd really like to get CURIE working here, both to simplify the queries on input and, especially, to reduce the clutter on output via prefixing. Please advise what I'm doing wrong.
Thank you,
Bill

Paul Fodor

unread,
Jul 9, 2019, 4:23:38 PM7/9/19
to Bill DeSmedt, ErgoAI, Flora-2, and XSB Users Forum
Hi Bill,

Iriprefixes in rdf_load are "prefixes for compact URIs (curi’s) used inside the input RDF/OWL files."

What you want are IRI Prefixes used inside ErgoAI for querying. 
chapter 42.2.1 
They are defined with iriprefix predicate and they are available for querying in the module in which they were defined.
In your case, something like this should work: after or before you loaded the RDF file run the query: 
iriprefix{geo='https://[actual-path-name]/geo-ontology'}. 
Now you can query with:
geo#US_West_Sales_Region[?P->?O]@geomod. 

Regards,
Paul.

--
You received this message because you are subscribed to the Google Groups "ErgoAI, Flora-2, and XSB Users Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-Flora2-XSB...@coherentknowledge.com.
To view this discussion on the web visit https://groups.google.com/a/coherentknowledge.com/d/msgid/ErgoAI-Flora2-XSB-forum/8319039e-a2a5-487d-b312-f73fc413ebd2%40coherentknowledge.com.


--
-------------------------------
Paul Fodor, PhD
E-mail: paul....@coherentknowledge.com
http://www.coherentknowledge.com
-------------------------------

Bill DeSmedt

unread,
Jul 9, 2019, 8:18:55 PM7/9/19
to ErgoAI-Flor...@coherentknowledge.com
Hi, Paul --

I tried invoking <iriprefix{geo='https://[actual-path-name]/geo-ontology'}.> but it didn't seem to be doing anything.

When I ran <prefix{?prefix,?expansion}@geomod.> to check, I didn't see <geo> at all among the list of prefixes.

I then ran <prefix{?prefix,?expansion}.>, and that found the <geo> prefix all right, but its expansion was <"geo#"> -- can that be right?

Bill

Michael Kifer

unread,
Jul 9, 2019, 8:30:15 PM7/9/19
to ErgoAI-Flor...@coherentknowledge.com

On 7/9/19 8:18 PM, Bill DeSmedt wrote:
Hi, Paul --

I tried invoking <iriprefix{geo='https://[actual-path-name]/geo-ontology'}.> but it didn't seem to be doing anything.

When I ran <prefix{?prefix,?expansion}@geomod.> to check, I didn't see <geo> at all among the list prefixes.


I am not sure what <...> is supposed to mean. Anyway, if you are interested in @geomod then you should have run

?- iriprefix{geo='https://[actual-path-name]/geo-ontology'}@geomod.


Prefixes are local to modules.



I then ran <prefix{?prefix,?expansion}.>, and that found the <geo> prefix all right, but its expansion was <"geo#"> -- can that be right?


No, you are seeing


ergo> prefix{?p,?e}@geomod.

?p = geo
?e = geo#''  (https://[actual-path-name]/geo-ontology)


which is correct.  geo#'' is a curi form (ie, expand geo and concat with an empty string) and https://[actual-path-name]/geo-ontology is the full expansion.

--

       --- michael




Bill

On Tuesday, July 9, 2019 at 12:55:30 PM UTC-7, Bill DeSmedt wrote:
I'm having trouble understanding how to use the IRIs specified as the third (?IriPrefixes) argument to the rdf_load command.
This command seems to work to set the IRIs up --

System[rdf_load('/Users/bill.desmedt/Desktop/geo_ontology.owl','','geo = "https://[actual-path-name]/geo-ontology#"',geomod)]@\owl.

-- i.e., it produces no syntax errors, and the original query (shown immediately below) still yields the desired result (inter alia, a list of all the US States belonging to the sales region in question):

"https://[actual-path-name]/geo-ontology#US_West_Sales_Region"^^\iri[?P->?O]@geomod.

However, my attempts to actually use the compact URI thus created have all failed. So far, I've tried the variations below. with the results shown in parentheses:

"geo:US_West_Sales_Region"^^\iri[?P->?O]@geomod.
  (returns "No answers found")
geo:US_West_Sales_Region^^\iri[?P->?O]@geomod.
   (returns syntax error)
geo:US_West_Sales_Region[?P->?O]@geomod.
   (returns "No answers found")
geo:"US_West_Sales_Region"^^\iri[?P->?O]@geomod.
   (returns syntax error)
  
I'd really like to get CURIE working here, both to simplify the queries on input and, especially, to reduce the clutter on output via prefixing. Please advise what I'm doing wrong.
Thank you,
Bill
--
You received this message because you are subscribed to the Google Groups "ErgoAI, Flora-2, and XSB Users Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-Flora2-XSB...@coherentknowledge.com.

Bill DeSmedt

unread,
Jul 9, 2019, 9:12:57 PM7/9/19
to ErgoAI, Flora-2, and XSB Users Forum
Thank you veru much, Michael -- I still haven't got the query running with the CURI, but IRIs for the answers are all compacted. Apologies for the angle brackets, I was running out of punctuation to set the queries/commands off from the rest of the text. Apologies as well for the incessant questons, many of which I could have answer myself given greater familiarity with the Ergo documentation. Unfortunately, I'm sort of under the gun here to come up with a recommendation, so your expert assistance is much appreciated.
Bill

On Tuesday, July 9, 2019 at 5:30:15 PM UTC-7, Michael Kifer wrote:

On 7/9/19 8:18 PM, Bill DeSmedt wrote:
Hi, Paul --

I tried invoking <iriprefix{geo='https://[actual-path-name]/geo-ontology'}.> but it didn't seem to be doing anything.

When I ran <prefix{?pref...@geomod.> to check, I didn't see <geo> at all among the list prefixes.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-Flora2-XSB-forum+unsubscribe@coherentknowledge.com.

Michael Kifer

unread,
Jul 9, 2019, 9:16:48 PM7/9/19
to ErgoAI-Flor...@coherentknowledge.com, Paul Fodor
No problem. Do you have logical errors now or still syntax?
--
Sent from my mobile.

Bill DeSmedt

unread,
Jul 9, 2019, 10:43:20 PM7/9/19
to ErgoAI, Flora-2, and XSB Users Forum, fodo...@gmail.com
Neither logical nor syntactic, as far as I can tel.
geo#US_West_Sales_Region[?P->?O]@geomod. just returns "no answer found",
OTOH, "https://[actual-path-name]/geo-ontology#US_West_Sales_Region"^^\iri[?P->?O]@geomod. produces the desired answer (a list of all the states in the US West Sales Region), but using CURIs instead of full IRIs -- progress! :)
-B

Paul Fodor

unread,
Jul 10, 2019, 12:44:45 PM7/10/19
to Bill DeSmedt, ErgoAI, Flora-2, and XSB Users Forum, fodo...@gmail.com
Hi Bill,

I think we are lost on this side what is actually not working.

Did you try the following query after you loaded your ontology?

?- iriprefix{geo='https://[actual-path-name]/geo-ontology'}@geomod.
then query:
?- geo#US_West_Sales_Region[?P->?O]@geomod. 

Regards,
Paul.

To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-Flora2-XSB...@coherentknowledge.com.

--
You received this message because you are subscribed to the Google Groups "ErgoAI, Flora-2, and XSB Users Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-Flora2-XSB...@coherentknowledge.com.
To view this discussion on the web visit https://groups.google.com/a/coherentknowledge.com/d/msgid/ErgoAI-Flora2-XSB-forum/1c8a0d9a-122c-422b-8499-cc285cdd93d9%40coherentknowledge.com.

Bill DeSmedt

unread,
Jul 11, 2019, 1:14:29 PM7/11/19
to ErgoAI, Flora-2, and XSB Users Forum, rea...@gmail.com, fodo...@gmail.com

Sorry to drop off the radar yesterday, Paul – I had to prep for a major presentation coming up today. In particular, I didn’t have a chance to follow up on Michael's note below until this morning:


> And how exactly geo is defined? Does it have # at the end?


... When I checked, my iriprefix command did not have a # at the end (nor did the original instruction from Michael). Once added, everything worked.

Thanks again,

Bill

To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-Flora2-XSB-forum+unsubscribe@coherentknowledge.com.

--
You received this message because you are subscribed to the Google Groups "ErgoAI, Flora-2, and XSB Users Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-Flora2-XSB-forum+unsubscribe@coherentknowledge.com.


--
-------------------------------
Paul Fodor, PhD
E-mail: paul...@coherentknowledge.com
http://www.coherentknowledge.com
-------------------------------
Reply all
Reply to author
Forward
0 new messages