I am using OWL API to load different files and merge into one for reasoning. I have one file describing the ontology and several files with individuals. Every individual has foaf properties, e.g., foaf:title, when I print the axioms it shows
'AnnotationAssertion(http://xmlns.com/foaf/0.1/title...'
and reasoning does not work. If I add
<'owl:DatatypeProperty rdf:about="http://xmlns.com/foaf/0.1/title'/>
into the individual file than title loads as
'DataPropertyAssertion(http://xmlns.com/foaf/0.1/title...' and reasoning works.
In the FOAF ontology is says that it is a data property, but loading it did not work either. I am using OWLOntologyMerger to merge the ontologies.
And I cannot add that into every file. Is there a way to do it programmatically or any way?
Thanks.
Use owl:imports from each file to import the base ontology, or foaf.
The problem here is that the owl api needs the declaration to be available either in the file or in the imported ontologies. It is not possible to parse rdf/XML unambiguously otherwise.
Related
I want to import some classes in Protege from different ontologies to my ontology. For example, I need the classes foaf:Person, org:Site, vcard:Organization, and many more.
I don't want to create them by myself (and modifying their IRI). When I did import the whole ontology (Schema.org, vCard, FOAF, …), I had many elements that I don't need.
Is there any way to do it?
— Have you looked at this thread: protege-project.136.n4.nabble.com/…
— I tried to use it, but it didn't work.
There are subtle moments, especially on step 5.
Open your target ontology.
Open the source ontology in the same window.
Select Refactor > Copy/move/delete axioms:
Select axiom selection method.
Select signature (i. e. a set set of classes, properties etc.) to import. Do not forget to press >> !
Now you can preview axioms to be imported.
Select what you want to do:
8-9. Select your target ontology:
Voila!
I'm wondering if there is a website or a way to get the list of all the Schema.org schemas under a specific category (ex: Place).
I found the complete list on Schema.org - they also provide a JSON-LD file - but there's no way to filter/order this easily.
My goal is to get the list of all the places in a nice array (PHP, JSON, whatever).
Most vocabularies/ontologies are defined using RDF.
The vocabulary Schema.org is no exception. The canonical/machine-readable representation of Schema.org is provided in HTML+RDFa:
http://schema.org/docs/schema_org_rdfa.html
This file always contains the current release. If you are interested in specific versions of Schema.org, snapshots are available.
As a quick overview:
Each Schema.org type is of type rdfs:Class.
Sub-types are specified with the rdfs:subClassOf property.
Each Schema.org property is of type rdf:Property.
Sub-properties are specified with the rdfs:subPropertyOf property.
The domains of a property (i.e., on which types this property is expected) are specified with the schema:domainIncludes property.
The ranges of a property (i.e., which values are expected) are specified with the schema:rangeIncludes property.
RDFa is a RDF serialization which many RDF parsers support (if not, it’s simple to automatically convert it into other RDF serializations, like Turtle, RDF/XML, or JSON-LD). There are many different tools and libraries available for this purpose. (You should use an RDF-aware tool instead of trying to parse the file as HTML.)
I have a protege project and i have saved it in .owl file format and i want now to genrate a .n3 file from the same project. Is there a way out using Protege 4.3?
I don't think this is possible. However, if you are using Protege to create the OWL file, chances are that you don't need specific features of N3 that are not part of Turtle.
Turtle is a subset of N3:
Turtle is another subset, for only expressing RDF. It is like n3-rdf
below except that it does not have the path syntax.
So the answer is: save it as Turtle syntax and change the extension to .n3
Note: If by any chance you need to use named graphs (TRIG) you can manually edit the file and add the corresponding name like this:
//prefixes
:graphName {
// ....
}
I'm new here, and although I've searched for something like this, I couldn't find an answer. So here is my question: How Fuseki handles owl:imports?
Details: I've defined a set of ontologies in different owl files. Let's call two of them of subDomainA.owl and subDomainB.owl.
To "join" these ontologies, I've defined a single owl file that imports the others. Let's call it completeDomain.owl, which owl:imports subDomainA.owl and subDomainB.owl. There are a few statements explicitly declared in completeDomain.owl. If it's not clear, It's something like sweetAll.owl in SWEET.
I need to import these owl files (with RDF/XML syntax) into TDB using Fuseki. How these imports will be handled? I mean, should I load the completeDomain.owl to the default graph and subDomainA.owl and subDomainB.owl to their respective graphs and Fuseki would "understand" imports and let me query all of them at once?
Using tdb:unionDefaultGraph is the same thing? What would happen with the statements declared in completeDomain.owl that uses entities declared in the subDomain ontologies? Also, I couldn't see the difference of tdb:unionDefaultGraph and Union Model.
As you can see, I'm a little bit confused and any help will be appreciated!
Following the tips from Joshua bellow(thanks for them, by the way), here is the answer:
To organize owl:imports into Fuseki, there are 3 options:
1) Import all ontologies files to the default graph.
2) Configure the store using tdb:unionDefaultGraph with true value, and import each file to its own named graph. This way, Fuseki will answer a query to the default graph with the union of all named graphs. Also, each graph can be acessed by its named graph and/or SPARQL GRAPH.
3) A Union Model combines in a single graph other graphs. Any app would not be able to query the graphs separatedely.
The original answer to this question is here!
I am trying to develop a plugin/component that can change the media file format from one to another. Specifically, I need it to convert the "tiff" file to array/single copy of "jpg" image file.
Kindly guide, how I can implement it or is there any kind of tutorial link from where either I can download it or take some help to develop it. Thanks in advance.
We did this in our CMS (built on CakePHP 1.2; sorry if there are any significant discrepancies I'm not aware of) using a behaviour. That makes the controller logic very easy (in fact we use a baked controller without any modification at all).
Unfortunately TIFF isn't a supported file format in GD (the default image manipulation library in PHP). You'll need to use ImageMagick or an equivalent tool to do the actual conversion itself, but the logic for implementing it in your CakePHP project won't be any different to what I describe here.
The behaviour (in our case) was used to generate images as thumbnails as well as page resolution and to convert the uploaded file format into JPEG.
In its beforeSave() method it checked that data was specified (and that there was no error), and then pulled the tmp_name value from the posted data (and removed the posted data object).
In its afterSave() method, it actually performed the image conversion task itself (putting the generated images in the expected location on disk), then updated any foreign keys on extended models with the uploaded image's ID. We do this in the afterSave() operation so we have a database ID to use to name the files on disk.
In its afterDelete() method we unlink the files on disk.
Using the behaviour in the model is as simple as telling the model (where ContentImage is the name of the behaviour):
var $actsAs = array('ContentImage');
Although we also use the model to define the output directory since we had a few models that implemented the behaviour, and it felt like the right thing to do, e.g. in the model:
function getThumbnailDir() {
return WWW_ROOT.'img'.DS.'upload'.DS.'thumb';
}
and in the behaviour itself the output path becomes:
$Model->getThumbnailDir().DS.$Model->id.'.jpg'