Michael G. is there a way to upload an ontology (.ttl) to the Voicebox and make some questions/sparql against the uploaded ontology?
Michael G. I have tried it but it has some problems. For example this is the question: # can you generate a SPARQL query from this question "Can you retrieve the title, the journal, and the publication date for all journal articles that mention 'running' in their title and were published in the 2000s." expected result:
PREFIX fabio: <http://purl.org/spar/fabio#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?title ?journal ?publicationDate
WHERE {
?article rdf:type fabio:JournalArticle .
?article fabio:hasTitle ?title .
?article fabio:isPartOf ?journal .
?article fabio:hasPublicationDate ?publicationDate .
FILTER (regex(?title, "running", "i") && year(?publicationDate) >= 2000 && year(?publicationDate) < 2030)
}
voicebox result: (has errors in prefix)
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix so: <https://schema.org/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?title ?journal ?date
WHERE {
?article a stardog:ecomm:JournalArticle .
?article stardog:ecomm:title ?title .
?article stardog:ecomm:journal ?journal .
?article stardog:ecomm:publicationDate ?date .
FILTER (("2000-01-01"^^xsd:date <= ?date && "2029-12-31"^^xsd:date >= ?date))
}
from your point of view which one is more accurate and helpful for me. chatGPT or Gemini or maybe any other engine
another weak point in Apex example is extracting the keywords from the question to generate a small ontology-subset. the chatGPT couldn't always guess the correct keywords and split them into entities and properties. so I looked for alternative way to let LLM understand my ontology and provide me Sparql query for my questions related to the ontology. I hope you didn't get lost ^_^
thanx for these resources. In fact what exactly looking for is to make the LLM help me generating the SPARQL Query for the question answer. So I found this resource but it doesn't generate an accurate result. if any change on the question then the generated sparql query will be not correct. https://apex974.com/articles/chatgpt-for-info-retrieval-from-knowledge-graph
Hi everyone, Do you know any way that I can generate SPARQL query from an Ontology or Ontology-subset using LLM ?
Hi everyone, I was trying to use pyRDF2Vec to convert from KG to vectors I got the following error if any one can help source:
walks = KG(location='./countries.ttl', skip_predicates=[rdflib.term.URIRef('http://dbpedia.org/ontology/abstract'), rdflib.term.URIRef('http://dbpedia.org/ontology/flag'), rdflib.term.URIRef('http://dbpedia.org/ontology/thumbnail'), rdflib.term.URIRef('http://dbpedia.org/ontology/wikiPageExternalLink'), rdflib.term.URIRef('http://dbpedia.org/ontology/wikiPageID'), rdflib.term.URIRef('http://dbpedia.org/ontology/wikiPageRevisionID'), rdflib.term.URIRef('http://dbpedia.org/ontology/wikiPageWikiLink'), rdflib.term.URIRef('http://dbpedia.org/property/flagCaption'), rdflib.term.URIRef('http://dbpedia.org/property/float'), rdflib.term.URIRef('http://dbpedia.org/property/footnoteA'), rdflib.term.URIRef('http://dbpedia.org/property/footnoteB'), rdflib.term.URIRef('http://dbpedia.org/property/footnoteC'), rdflib.term.URIRef('http://dbpedia.org/property/source'), rdflib.term.URIRef('http://dbpedia.org/property/width'), rdflib.term.URIRef('http://purl.org/dc/terms/subject'), rdflib.term.URIRef('http://purl.org/linguistics/gold/hypernym'), rdflib.term.URIRef('http://purl.org/voc/vrank#hasRank'), rdflib.term.URIRef('http://www.georss.org/georss/point'), rdflib.term.URIRef('http://www.w3.org/2000/01/rdf-schema#comment'), rdflib.term.URIRef('http://www.w3.org/2000/01/rdf-schema#label'), rdflib.term.URIRef('http://www.w3.org/2000/01/rdf-schema#seeAlso'), rdflib.term.URIRef('http://www.w3.org/2002/07/owl#sameAs'), rdflib.term.URIRef('http://www.w3.org/2003/01/geo/wgs84_pos#geometry'), rdflib.term.URIRef('http://dbpedia.org/ontology/wikiPageRedirects'), rdflib.term.URIRef('http://www.w3.org/2003/01/geo/wgs84_pos#lat'), rdflib.term.URIRef('http://www.w3.org/2003/01/geo/wgs84_pos#long'), rdflib.term.URIRef('http://www.w3.org/2004/02/skos/core#exactMatch'), rdflib.term.URIRef('http://www.w3.org/ns/prov#wasDerivedFrom'), rdflib.term.URIRef('http://xmlns.com/foaf/0.1/depiction'), rdflib.term.URIRef('http://xmlns.com/foaf/0.1/homepage'), rdflib.term.URIRef('http://xmlns.com/foaf/0.1/isPrimaryTopicOf'), rdflib.term.URIRef('http://xmlns.com/foaf/0.1/name'), rdflib.term.URIRef('http://dbpedia.org/property/website'), rdflib.term.URIRef('http://dbpedia.org/property/west'), rdflib.term.URIRef('http://dbpedia.org/property/wordnet_type'), rdflib.term.URIRef('http://www.w3.org/2002/07/owl#differentFrom')], literals=[], fmt='turtle', mul_req=False, cache=TTLCache([], maxsize=1024, currsize=0), _is_remote=False)
print('==================')
print(walks)
print('------------------')
corpus = [walk for entity_walks in walks for walk in entity_walks]
self._model.build_vocab(corpus, update=is_update)
self._model.train(
corpus,
total_examples=self._model.corpus_count,
epochs=self._model.epochs,
)
return self
Error in this line
corpus = [walk for entity_walks in walks for walk in entity_walks]TypeError: 'KG' object is not iterable
u r welcome I am wondering why since 4 years this project not helpful. is it because lack of knowledge in this area or it's not useful.
I think there will be a conflict if I used the tow plugins. isn't it? org.neo4j.server.thirdparty_jaxrs_classes=de.unikiel.inf.comsys.neo4j=/rdf dbms.unmanaged_extension_classes=n10s.endpoint=/rdf in fact I am not good javaπ
Thanx JesΓΊs Barrasa what about neo4j-sparql-extension-yars is it possible to run on the latest version neo4j 4.2.7 I found the merging changes from org.neo4j.server.thirdparty_jaxrs_classes to dbms.unmanaged_extension_classes Renamed I don't know if it's possible to add multiple classes to this parameter or do you suggest. It seams satisfying which provide sparql endpoint to cypher