Pattern Matcher query

64 views
Skip to first unread message

vishnup...@gmail.com

unread,
Sep 27, 2016, 10:15:04 AM9/27/16
to opencog
Hello All,

I want a query such that, 
when i have a particular concept node, it should return the list of concept nodes linked to it. 

For eg:

I have the following

(EvaluationLink(PredicateNode "info ")(ListLink(ConceptNode  "[-77.0325, 38.8749]")(ConceptNode  "090")(ConceptNode  "Washington")(ConceptNode  "hello there")))

(EvaluationLink(PredicateNode "info ")(ListLink(ConceptNode  "[-77.0325, 38.8749]")(ConceptNode  "090")(ConceptNode  "Montgomery")(ConceptNode  "want coffee ")))

(EvaluationLink(PredicateNode "info ")(ListLink(ConceptNode  " ")(ConceptNode  "111")(ConceptNode  "Sydney")(ConceptNode  "pressure is about..")))


When i have ConceptNode "090", return all other concept nodes associated with it. something like below:

[-77.0325, 38.8749], Washington, hello there
[-77.0325, 38.8749],  Montgomery,  want coffee

How can i search? How to write a query for this ? 

Thanks in advance.

Linas Vepstas

unread,
Sep 27, 2016, 6:05:33 PM9/27/16
to opencog
The cog-incoming-set will return all links that contain some given atom. From this, you can build simple utilities that do what you want.  In fact, many of those simple utilities have been built. See  cog-get-partner cog-chase-link cog-get-link cog-get-pred cog-get-reference  Look in the file here:


These are all pre-loaded, already so you can view documentation online by sayying, for example   ,d cog-get-link  at the guile prompt, where  ,d is short for ,describe   Note the leading comma.

,a is short for ,apropos and also works
 
--linas

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/250186a9-fb14-46fc-a274-9e4d75b5350b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vishnup...@gmail.com

unread,
Sep 29, 2016, 9:49:15 AM9/29/16
to opencog, linasv...@gmail.com
Yes linas. I had a look. 
I got it working :-)
Thank you.

--Vishnu


On Wednesday, 28 September 2016 00:05:33 UTC+2, linas wrote:
The cog-incoming-set will return all links that contain some given atom. From this, you can build simple utilities that do what you want.  In fact, many of those simple utilities have been built. See  cog-get-partner cog-chase-link cog-get-link cog-get-pred cog-get-reference  Look in the file here:


These are all pre-loaded, already so you can view documentation online by sayying, for example   ,d cog-get-link  at the guile prompt, where  ,d is short for ,describe   Note the leading comma.

,a is short for ,apropos and also works
 
--linas
On Tue, Sep 27, 2016 at 9:15 AM, <vishnup...@gmail.com> wrote:
Hello All,

I want a query such that, 
when i have a particular concept node, it should return the list of concept nodes linked to it. 

For eg:

I have the following

(EvaluationLink(PredicateNode "info ")(ListLink(ConceptNode  "[-77.0325, 38.8749]")(ConceptNode  "090")(ConceptNode  "Washington")(ConceptNode  "hello there")))

(EvaluationLink(PredicateNode "info ")(ListLink(ConceptNode  "[-77.0325, 38.8749]")(ConceptNode  "090")(ConceptNode  "Montgomery")(ConceptNode  "want coffee ")))

(EvaluationLink(PredicateNode "info ")(ListLink(ConceptNode  " ")(ConceptNode  "111")(ConceptNode  "Sydney")(ConceptNode  "pressure is about..")))


When i have ConceptNode "090", return all other concept nodes associated with it. something like below:

[-77.0325, 38.8749], Washington, hello there
[-77.0325, 38.8749],  Montgomery,  want coffee

How can i search? How to write a query for this ? 

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages