Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using full IRI instead of prefix #45

Open
canarvaeza opened this issue Apr 25, 2018 · 6 comments
Open

Using full IRI instead of prefix #45

canarvaeza opened this issue Apr 25, 2018 · 6 comments

Comments

@canarvaeza
Copy link

Hi,

I'm working with a rdf stream which is generated from a JSON file, the tool I use give me a turtle file without prefixes. It seems that SWRL only work with prefixes, I try to write http://xmlns.com/foaf/0.1/Person
instead of foaf:Person In the SWRL tab and it does't work, says that html is not a prefix.

Can I use this in any way? or I have to create the prefixes (not god because we don't know the procedence of the data all times).

Here is the result file.
salida.ttl.txt

Thanks 😃

@martinjoconnor
Copy link
Member

Unfortunately, only prefixed names are supported by the SWRLAPI parser.

@canarvaeza
Copy link
Author

canarvaeza commented Apr 26, 2018 via email

@martinjoconnor
Copy link
Member

It would be quite a bit of work, unfortunately.

@canarvaeza
Copy link
Author

canarvaeza commented May 4, 2018 via email

@martinjoconnor
Copy link
Member

martinjoconnor commented May 7, 2018

Note that you may be able to handle this in your code depending in how you are doing the rule generation.

You can generate a unique prefix (e.g., autogen0) for each namespace without a prefix in the ontology and set this prefix using the OWLAPI so that the SWRL parser will recognize the prefix.

For example, if you encounter a URI http:/example.com/Classes/Dog where http:/example.com/Classes/ has no prefix definition you can do the following:

manager.getOntologyFormat(ontology).asPrefixOWLOntologyFormat().setDefaultPrefix("autogen" + i++, "http:/example.com/Classes/");

Then substitute the namespace + localname for the prefixed form in the rule (e.g., autogen0:Dog) and the parsing will work.

You will effectively be building a temporary prefix map.

@canarvaeza
Copy link
Author

canarvaeza commented May 8, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants