New Question:
I firstly start the Fuseki Server to create a new dataset called 'address_act':
fuseki-server --update --mem /address_act
here are the code to get data of each address and then add it to a Triplestore (database) in Fuseki Server:
import requests
import pandas as pd
import numpy as np
import re
from rdflib import Graph, Literal, URIRef
from rdflib.plugins.stores import sparqlstore
query_endpoint = 'http://localhost:3030/address_act/query'
update_endpoint = 'http://localhost:3030/address_act/update'
store = sparqlstore.SPARQLUpdateStore()
store.open((query_endpoint, update_endpoint))
g = Graph(identifier = URIRef('http://www.example.com'))
for i in range(1,3):
results = []
url = 'http://gnafld.net/address/?per_page=10&page=' + str(i)
page = requests.get(url)
response = requests.get(url)
response.raise_for_status()
results = re.findall('\"Address ID: (GAACT[0-9]+)\"', response.text)
for ad in results:
ad_url = 'http://gnafld.net/address/' + ad
ad_info = requests.get(ad_url).content
g.parse(data=ad_info, format='turtle')
store.add_graph(g)
It seems that the code works but when I browse http://localhost:3030/dataset.html?tab=info&ds=/address_act, It always shows that there is 0 triples in the graph.no triples in the graph I wonder whether it inserts the triples into the dataset successfully. If yes, then where can I find those triples? If not, how can I add the triples into the default graph? Any help is highly appreciated.