my main function says--

static void Main(string[] args) {

        Graph g = new Graph();
        FileLoader.Load(g, "\\cbcs.owl");

        TripleStore store = new TripleStore();
        store.Add(g);
        //Object results = store.ExecuteQuery("SELECT * WHERE { { ?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } } }");

        Object results = store.ExecuteQuery("PREFIX pre:<http://www.cbcs.com/ontologies/cbcs.owl#>" + "SELECT ?X ?Y WHERE { ?X pre:hasInstitutes ?Y .}");
        SparqlResultSet rset = (SparqlResultSet)results;

        //Enumerating via the Results property
        foreach (SparqlResult result in rset.Results)
        {
            Console.WriteLine(result.ToString());
        }

        Console.WriteLine("hello");
        Console.ReadLine();
    }

but it doesnt display the answer if my query is simple and without answer it works but with prefix it doesnt please help

asked 31 Jan '13, 06:37

jasmine's gravatar image

jasmine
-1
accept rate: 0%

converted to question 31 Jan '13, 07:06

Rob%20Vesse's gravatar image

Rob Vesse ♦
13.6k1715

If you have a separate question please ask it as such, do not post it as an answer to an existing question

(31 Jan '13, 07:07) Rob Vesse ♦ Rob%20Vesse's gravatar image
1

Secondly your question as written it not answerable as it stands:

1 - What is your data (include it or a small snippet you'd expect to match) 2 - What is the query that works and the query that doesn't work? Please separate these out from your code sample

(31 Jan '13, 07:08) Rob Vesse ♦ Rob%20Vesse's gravatar image

also asked on stackoverflow.

(31 Jan '13, 10:27) AndyS ♦ AndyS's gravatar image

As I commented without further information your query is not answerable, it could be any number of things causing your query to return no results.

See My query returns no results? in the FAQ for some suggestions of possible causes of the problem.

link

answered 31 Jan '13, 07:10

Rob%20Vesse's gravatar image

Rob Vesse ♦
13.6k1715
accept rate: 29%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1,251
×80

Asked: 31 Jan '13, 06:37

Seen: 691 times

Last updated: 31 Jan '13, 10:27