示例#1
0
def last_user():
	return endpoint.query("""
	PREFIX user: <https://github.com/superphy#User>
	PREFIX RDF_type: <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
	SELECT ?s
	WHERE {
	  ?s RDF_type: user:
	}
	ORDER BY DESC(?s)
	LIMIT 1
	""")
示例#2
0
def last_user():
    return endpoint.query("""
	PREFIX user: <https://github.com/superphy#User>
	PREFIX RDF_type: <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
	SELECT ?s
	WHERE {
	  ?s RDF_type: user:
	}
	ORDER BY DESC(?s)
	LIMIT 1
	""")
示例#3
0
def get_all_literals():
    return endpoint.query("""
	SELECT ?s ?p ?o
	WHERE {d
	  {?s ?p ?o
	   FILTER  ISLITERAL(?o)
	  }
	  UNION
	  {?s ?p ?o
	   FILTER  ISLITERAL(?p)
	  }
	  UNION
	  {?s ?p ?o
	   FILTER  ISLITERAL(?s)
	  }
	}""")
示例#4
0
def get_all_literals():
    return endpoint.query(
        """
	SELECT ?s ?p ?o
	WHERE {d
	  {?s ?p ?o
	   FILTER  ISLITERAL(?o)
	  }
	  UNION
	  {?s ?p ?o
	   FILTER  ISLITERAL(?p)
	  }
	  UNION
	  {?s ?p ?o
	   FILTER  ISLITERAL(?s)
	  }
	}"""
    )
示例#5
0
def get_all_uri_triples():
    return endpoint.query("""
	SELECT ?s ?p ?o
	WHERE {
	  {?s ?p ?o}
	  MINUS
	  {?s ?p ?o
	    FILTER ISLITERAL(?o)
	  }
	  MINUS
	  {
	    FILTER ISLITERAL(?p)
	  }
	  MINUS
	  {
	    FILTER ISLITERAL(?s)
	  }
	}""")
示例#6
0
def get_all_uri_triples():
    return endpoint.query(
        """
	SELECT ?s ?p ?o
	WHERE {
	  {?s ?p ?o}
	  MINUS
	  {?s ?p ?o
	    FILTER ISLITERAL(?o)
	  }
	  MINUS
	  {
	    FILTER ISLITERAL(?p)
	  }
	  MINUS
	  {
	    FILTER ISLITERAL(?s)
	  }
	}"""
    )
示例#7
0
def get_object_literals():  # Verified
    return endpoint.query("""SELECT ?s ?p ?o WHERE {?s ?p ?o FILTER  ISLITERAL(?o)}""")
示例#8
0
def get_all_triples():  # Verified
    return endpoint.query("""SELECT * {?s ?p ?o}""")
示例#9
0
def get_object_literals():  #Verified
    return endpoint.query(
        """SELECT ?s ?p ?o WHERE {?s ?p ?o FILTER  ISLITERAL(?o)}""")
示例#10
0
def get_all_triples():  #Verified
    return endpoint.query("""SELECT * {?s ?p ?o}""")