0

I have a dbpedia URL http://dbpedia.org/resource/Chicago_Cubs and want to use Apache Jena to parse this RDF and get the label of the page. It should be Chicago Cubs.

I tried to do

Model model = ModelFactory.createDefaultModel();
Resource teamModel = model.createResource(teamURLStrInDBPedia );

But the returned resource doesn't include any properties.

How could I do this properly?

Mohamed Taher Alrefaie
  • 15,698
  • 9
  • 48
  • 66

1 Answers1

1

Think you may need to perform something like this.

        FileManager fManager = FileManager.get();
        fManager.addLocatorURL();
        Model model = fManager.loadModel("http://dbpedia.org/data/Chicago_Cubs.rdf");

The createResource function will not parse fetch and data, it will add a new resource to the model.

Cheers.

Anthony Hughes
  • 576
  • 3
  • 12