Skip to content

Instantly share code, notes, and snippets.

@shawngraham
Last active April 1, 2024 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawngraham/ed3671a53180fc612ab30630a4cd50d1 to your computer and use it in GitHub Desktop.
Save shawngraham/ed3671a53180fc612ab30630a4cd50d1 to your computer and use it in GitHub Desktop.
knowledge graph extractor for openchat3.5 in jan.ai
You are an excellent assistant with deep knowledge of research in the field of illegal and illicit antiquities. Generate an ontology for the text that follows, using the following guidelines: 1 – Denote subjects and objects using relative hash-based hyperlinks i.e., negating the use of example.com. 2- Output response to a code-block. 3 – RETURN data as well-formatted HIGH QUALITY RDF-TURTLE triples
THOUGHT: I should identify all of the people involved first.
THOUGHT: I should then identify any organizations involved.
THOUGHT: I should then identify any artefacts.
THOUGHT: I should then connect people, organizations, and objects by determining the predicates that join them.
THOUGHT: It is important that I respect subject-predicate-object order of meaning.
THOUGHT: There should be no empty nodes.
THOUGHT: I should ignore in-text citations using parentheses.
You return high quality formatted RDF FOR EVERY POSSIBLE TRIPLE RELATED TO THE ANTIQUITIES TRADE. The entire code block is wrapped with back-ticks. Here is an example of the desired output:
```RDF
@prefix mydb: <http://mydb.org/> .
@prefix schema: <http://schema.org/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://mydb.org/id/1> a schema:Person ;
rdfs:label "Mirzan Marie" ;
schema:givenName "Marie" ;
schema:familyName "Mirzan" ;
mydb:businessPartner <http://mydb.org/id/2> ;
mydb:note "Middle name unknown" .
<http://mydb.org/id/2> a schema:Person ;
rdfs:label "Edwige" ;
schema:givenName "Edwige" ;
mydb:daughterOf <http://mydb.org/id/1> ;
mydb:openedGallery <http://mydb.org/id/3>```
## here is the result on the first paragraph, using openchat model
@prefix mydb: <http://mydb.org/> .
@prefix schema: <http://schema.org/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://mydb.org/id/1> a schema:Person ;
rdfs:label "Giacomo Medici" ;
schema:givenName "Giacomo" ;
mydb:startedDealingInAntiquities "1960s" ;
mydb:convicted "July 1967" ;
mydb:metAndSuppliedAntiquitiesTo <http://mydb.org/id/2> ;
mydb:openedGallery <http://mydb.org/id/4> ; ###<-- sg. mistake here. Should be 3. 4 is also 'Antiquaria Romana, but there given wrong country.
mydb:boughtIllegallyExcavatedArtifact "December 1971" ;
mydb:transportedArtifactToSwitzerland ; ###<- sg. syntax error here. mydb:transportedARtifactTo "Switzerland"
mydb:soldArtifactTo <http://mydb.org/id/2> .
<http://mydb.org/id/2> a schema:Person ;
rdfs:label "Robert Hecht" ;
schema:givenName "Robert" ;
mydb:metAndBoughtAntiquitiesFrom <http://mydb.org/id/1> .
<http://mydb.org/id/3> a schema:Place ;
rdfs:label "Antiquaria Romana" ;
mydb:locatedIn "Rome" .
<http://mydb.org/id/4> a schema:Place ; ##<-- mistake. Antiquaria Romana is in Rome.
rdfs:label "Antiquaria Romana" ;
mydb:locatedIn "Switzerland" .
<http://mydb.org/id/5> a schema:Artifact ;
rdfs:label "Euphronios (Sarpedon) krater" ;
mydb:illegallyExcavated "true" ;
mydb:boughtBy <http://mydb.org/id/1> ;
mydf:soldTo <http://mydb.org/id/2> . ##<-- sg syntax error. should be mydb
You are given unstructured text about the antiquities trade. Extrapolate as many relationships as you can from the prompt concerning individuals, organizations, places, and objects. Every node has a name, label. Every edge has a to and from with node names, and a label. Edges are directed, so the order of the from and to is important. Format as json.
Example: Mary Turlington made a ceramic Ducky in Big Pond in 2023; she had Kenny Wong paint it. It was bought by the Grand Narrows Museum in 2023 for $123456.
[{
"nodes": [{
"label": "the Ducky",
"type": "Object",
"madeIn": "Big Pond",
"date": "2023",
"potter": "Mary Turlington",
"painter": "Kenny Wong",
"price": "$123456"
}],
"edges": [{
"startNode": "the Ducky",
"endNode": "Grand Narrows Museum",
"type": "bought by",
"date": "2024"
}]
}]
{
"nodes": [
{
"label": "Giacomo Medici",
"type": "Person",
"location": "Rome, Italy"
},
{
"label": "Antiquaria Romana",
"type": "Business",
"location": "Rome, Italy"
},
{
"label": "Hydra Gallery",
"type": "Business",
"location": "Geneva, Switzerland"
},
{
"label": "Robert Hecht",
"type": "Person",
"location": "New York, USA"
},
{
"label": "Christian Boursaud",
"type": "Person",
"location": "Geneva, Switzerland"
},
{
"label": "Sotheby’s London",
"type": "Business",
"location": "London, UK"
},
{
"label": "Euphronios (Sarpedon) krater",
"type": "Artifact"
}
],
"edges": [
{
"startNode": "Giacomo Medici",
"endNode": "Antiquaria Romana",
"type": "owns",
"label": "owned"
},
{
"startNode": "Giacomo Medici",
"endNode": "Robert Hecht",
"type": "supplies",
"label": "supplied"
},
{
"startNode": "Giacomo Medici",
"endNode": "Euphronios (Sarpedon) krater",
"type": "purchased",
"label": "purchased"
},
{
"startNode": "Giacomo Medici",
"endNode": "Christian Boursaud",
"type": "partnered_with",
"label": "partnered"
},
{
"startNode": "Antiquaria Romana",
"endNode": "Giacomo Medici",
"type": "owned_by",
"label": "owned by"
},
{
"startNode": "Giacomo Medici",
"endNode": "Hydra Gallery",
"type": "owns",
"label": "owns"
},
{
"startNode": "Giacomo Medici",
"endNode": "Christian Boursaud",
"type": "consigns_material_to",
"label": "consigns material to"
},
{
"startNode": "Christian Boursaud",
"endNode": "Sotheby’s London",
"type": "consigns_material_to",
"label": "consigns material to"
},
{
"startNode": "Giacomo Medici",
"endNode": "Euphronios (Sarpedon) krater",
"type": "illegally_purchased",
"label": "illegally purchased"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment