title: dotnetrdf Graph Sparql query
body: <p>with rdf triples like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE rdf:RDF [&lt;!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'&gt;
  &lt;!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'&gt;
  &lt;!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#'&gt;]&gt;
  &lt;rdf:RDF xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
           xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
           xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:dnr="http://www.dotnetrdf.org/configuration#"
           xml:base="http://www.example.org/"
           xmlns:nss="http://www.example.org/startTime"
       xmlns:nse="http://www.example.org/endTime"&gt;
  
    &lt;rdf:Description rdf:about="Fadi"&gt;
      &lt;ns0:eat xmlns:ns0="http://example.org/"&gt;Apple&lt;/ns0:eat&gt;
      &lt;nss:startTime&gt;00:01:38&lt;/nss:startTime&gt;
      &lt;nse:endTime&gt;00:01:39&lt;/nse:endTime&gt;
    &lt;/rdf:Description&gt;
  
    &lt;rdf:Description rdf:about="I"&gt;
      &lt;ns1:love xmlns:ns1="http://example.org/"&gt;You&lt;/ns1:love&gt;
      &lt;nss:startTime&gt;00:05:35&lt;/nss:startTime&gt;
      &lt;nse:endTime&gt;00:06:39&lt;/nse:endTime&gt;
    &lt;/rdf:Description&gt;
  &lt;/rdf:RDF&gt;
  </code></pre>
  
  <p>how can i query about subject or object?</p>
  
  <p>my code:</p>
  
  <pre><code>Graph myGraph = new Graph();
  FileLoader.Load(myGraph, "C:\\Users\\hasoOn\\Desktop\\tt.rdf");                
  
  TripleStore store = new TripleStore();
  store.Add(myGraph);
  
  SparqlParameterizedString queryString = new SparqlParameterizedString();
  queryString.CommandText = "PREFIX ex: &lt;http://example.org/&gt; SELECT * WHERE { { ex:fadi ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } } } ";
  SparqlQueryParser parser = new SparqlQueryParser();
  SparqlQuery query = parser.ParseFromString(queryString.CommandText);
  SparqlResultSet results = (SparqlResultSet)store.ExecuteQuery(query);
  
  if (results is SparqlResultSet)
  {
      SparqlResultSet rset = (SparqlResultSet)results;
      foreach (SparqlResult result in rset)
      {
          Console.WriteLine(result);   
      }
  } 
  </code></pre>
  
  <p>with my code below i get all answers from the query. can anyone help me to get for just subject = fadi?</p>